Answered
Finding intersecting rows in column vectors of varying length?
>> [~,~,ix]=intersect([v1x(:) v1y(:)],[v2x v2y],'rows') ix = 1 5 >>

11 years ago | 0

| accepted

Answered
Find Diverging point of two arrays
Alternatively, if similar behavior is always expected, you could fit a piecewise linear model to each curve and compare the slop...

11 years ago | 0

| accepted

Answered
Generating random numbers with mean and std dev specified
The statistics for a normal are the mean and standard deviation, _not_ the range of the observations as for a uniform, say. In ...

11 years ago | 0

Answered
Error : Matrix dimensions must agree
(A1-B*F1)' * P * (A1-B*F1) - P < 0 where, A1 is a 12 x 12 matrix B is a 12 x 4 matrix and F1 is a 4 x 12 matrix ...

11 years ago | 0

Answered
With a 3D Matrix, How can I plot various 2D lineplots?
plot(reshape(data,6,[]).') will be the six in order from 1,1 to 3,2 by column order; iow each of the first column followed ...

11 years ago | 0

Answered
Find a mean square root velocity of each row in matrix
v=rms(x,2)/C; % presuming one C; if per row, the define the column vector and use "./C" doc rms % for details

11 years ago | 0

Answered
Creating character codes from text file
# is pretty straightforward to replace characters with empty, thereby removing them entirely. *regexp* is one way # build a "l...

11 years ago | 0

Answered
Question with accessing field in a structure
isA=ismember([Recordings.Task].','A'); [] returns comma-separated list as array, .' transforms it to column vector... Ma...

11 years ago | 0

Answered
Can you tell me why my x-axis grid in plot (b) shows incorrectly?
HG engine determines in default size there isn't enough room for the tick labels so defaults to the three values. Tick labels a...

11 years ago | 1

| accepted

Answered
Add a second x-axis to a given multi-series plot
See File Exchange <http://www.mathworks.com/matlabcentral/fileexchange/4036-addtxaxis AddTXaxis> which does precisely what you'...

11 years ago | 0

| accepted

Answered
Timestamp not converting to a string
Given the error and that *load* returned a double array, what follows was a logical next step-- >> load timestamps.mat >> ...

11 years ago | 0

Answered
Fit function versus lsqcurvefit
It's your choice; *fit* is a wrapper around a whole bunch of stuff to try to make a general interface for the Curve Fitting Tool...

11 years ago | 0

Answered
Why doesn't the graph show?
Check what your _t_ actually is (instead of what you intend it to be)...

11 years ago | 0

Answered
Plotting of a prediction line over scatterplot
Sort age before computing y(*); it must be they're not in order so the line follows their sequence in order on the x axis. (*...

11 years ago | 0

| accepted

Answered
Plot two graphs in the same figure, that have different number of points from text file
Try [f1 s1 f2 s2]=textread('data_mod.txt','%f %f %f %f'); f2(f2==0)=nan; s2(s2==0)=nan; subplot(2,1,1),plot(f1,s1) ...

11 years ago | 1

Answered
How do I calculate the speed or a crane the moves by a rack using a pinion?
One revolution is 9.5*pi linear inches, roughly. Exactly will depend on the actual contact radius of the gear with the track. ...

11 years ago | 0

Answered
Is it possible to directly access integer bits in computer memory?
You're probably barking up the wrong tree conceptually in thinking you're going to do anything faster than using straightforward...

11 years ago | 0

Answered
Using multiple functions in combination
Looks to me like it would just be ring(t,nstars,ringradius,npoints,R,r) if you remove the lines within *ring* that redef...

11 years ago | 0

| accepted

Answered
Inputting an equation as a variable
No need; if you set the input vector prior to calling *input* and your user can enter an executable Matlab statement, *input* ev...

11 years ago | 0

| accepted

Answered
Linear Interpolate to n equally spaced points
doc interp1 >> v=[0 5 10 5 0]; L=length(v); >> interp1(1:L,v,linspace(1,L,15)) ans = Columns 1 through 10 ...

11 years ago | 0

| accepted

Answered
Take a vector of numbers, and convert them to a string and store in a single cell?
If you leave as string, can't put in the numeric array; would have to use a cell array instead. OTOH, if you convert to the str...

11 years ago | 1

Answered
Problems using importdata function
Has to be there's something not being shown...like a variable set in the workplace that isn't in the script (which makes me wond...

11 years ago | 0

Answered
How to plot line with different line style part way through?
# Put each device x,y data in a separate column in an array and call *plot* Each column will automagically be a new line with c...

11 years ago | 0

Answered
How to remove empty matrix : 1 by 0 in my code
You didn't provide an output argument to either function doc function % for details

11 years ago | 0

Answered
I want to get/search for all of the ".mat" files in an exact directory and all of the subdirectories within. How can I get all of the subdirectories and subfiles to my variables list?
Simpler way is to use the OS directory search...for Windows s=uigetdir; % initial subdirectory [~,d]=dos(['dir /s /b...

11 years ago | 0

Answered
How can I import ordered pairs of data from a text file?
Alternatively to Per's "most excellent" answer and perhaps a little easier for the neophyte to see on the format string-- d...

11 years ago | 0

| accepted

Answered
Extract elements of the array using any
Problem is you need to keep the length of the logical vector the same as the original length; *diff* shortens it by one without ...

11 years ago | 0

Answered
Taking a lot of time to solve an expression
Don't have the symbolics so "know nuthink!" on that side but >> fn=@(y) 3.591*y*(1-y)^0.77-0.125; >> yz=fsolve(fn,0.5) ...

11 years ago | 0

| accepted

Load more