Answered
random amount of zeros
zeros(1,randi(IMAX)) where IMAX is a preselected maximum number

13 years ago | 1

Answered
Displaying a Home Address Correctly
doc sprintf % and friends

13 years ago | 0

Answered
How to plot the data with the mean plus standard deviation ?
Another one of those cases that is so obvious you'd think *area* would have the option or there would be another builtin functio...

13 years ago | 0

Answered
Binary file input help?
Ah....that does help. The description at the link doesn't say there's any timestamp _inside_ the file; just the header record o...

13 years ago | 0

Answered
How to define multiple while loop conditions?
if beta1d>=beta1dpoz beta1d=beta1d else r1=r1 while beta1d>=beta1dpoz ... You've got the _while_ c...

13 years ago | 0

| accepted

Answered
Replacing all 999 by zeros
The latter isn't what you think it might be -- Matlab expands the subscript vectors to a list. As doc for *find* says, that for...

13 years ago | 1

| accepted

Answered
Why is matlab not computing this correctly?
I'm guessing because you're evaluating the correlation for the wrong T -- generally these are either reduced temperatures or dif...

13 years ago | 0

Answered
How can I plot a sine wave with my data? I'm almost there but I'm stuck
t = -0.001:0.001; %time (x-axis) There's your problem--the default interval for colon ':' is 1 -- hence the next interval i...

13 years ago | 0

Answered
Display first and last rows and first and last columns at once?
Only way to do this is by ascii representation-- >> x=ones(4);x(2:3,2:3)=0; >> c=num2str(x); >> c(c=='0')=' '; >> disp(c...

13 years ago | 0

| accepted

Answered
Matlab doesnt save my work but I can find it from the "current folder" tab. How can this be possible?
You're in a folder "Matlab" in the SaveAs dialog, _not_ in "Matlab R2012a". It looks like it did precisely what you asked for...

13 years ago | 0

| accepted

Answered
I have datenum() error ?
It indicates that given the range of data on the x-axis *datetick* decided quarterly dates would be the best default (or you exp...

13 years ago | 1

| accepted

Answered
How to protect MEX file from empty inputs
doc mxIsEmpty

13 years ago | 1

Answered
How can I get MATLAB to plot a date on the x-axis?
First convert the text string date format to Matlab serial dates -- doc datenum Then plot with that value as the x-axis ...

13 years ago | 1

| accepted

Answered
Matlab function slow first time, much faster subsequently. Why?
Matlab is interpreted so when the extremely large code file is read the first time the JIT compiler has to first load it into me...

13 years ago | 2

| accepted

Answered
error using fzero in a loop
From the doc's for *fzero* _X = fzero(FUN,X0) ... FUN is a function handle._ Your code is X(H)=fzero(diff(y),(x1(H)+...

13 years ago | 0

| accepted

Answered
Read data file with strings and integers
With *textscan* use the 'collectoutput',true option to put the numeric values into one cell then convert to an array w/ *cell2ma...

13 years ago | 0

| accepted

Answered
Help For a new type of plot
Looks like an *errorbar* plot with two columns should do the trick easily... doc errorbar % for more details, examples...

13 years ago | 0

| accepted

Answered
Using fprintf to specify a filename for write to text file in loop
Use *sprintf* instead--*fprintf* w/o a unit number writes to screen so you're left w/ nothing in the filename location. fi...

13 years ago | 2

| accepted

Answered
How can i make the length of two vectors of two sound files(wav) equal to each other?
First, don't use *sum* as a variable name; it's an internal Matlab function you'll not want to alias... Second, to fix the le...

13 years ago | 0

Answered
how to find almost equal entries in 2 row vectors?
Oh, that's a different problem than I thought you meant-- >> interp1([p42-p43]',delta',0) ans = 1.0014 >> Or, use f...

13 years ago | 1

Answered
how to find almost equal entries in 2 row vectors?
Just one line for brevity, same works for entire altho size of outputs grows. Might want to select overlapping subsections via ...

13 years ago | 2

| accepted

Answered
How do I combine multiple plots in a for loop?
hold on after first.

13 years ago | 0

Answered
How can I isolate data from a large input file?
It finally came to me!!! :) Actually, was looking at it wrong -- to find the beginning of a movement you don't care which di...

13 years ago | 0

Answered
Importing text files into variables with the same name
As Cedric has already hinted, you really, Really, REALLY don't want to do this...see <http://matlab.wikia.com/wiki/FAQ#How_ca...

13 years ago | 0

Answered
Plot with scale and adjusted
This looks like the same question I answered yesterday in the newsgroup -- You're adjusting the [X|Y]tick and [X|Y]ticklabel ...

13 years ago | 0

Answered
How to create if statements inside switch statement?
a) sure...any coding construct contained within the switch clause can be part of the clause-- switch thevariable case ...

13 years ago | 0

| accepted

Answered
how to swap this matrix
Z(1:3)=flipud(Z(1:3)); Only works because of odd number, of course. In general to swap individual elements will still take...

13 years ago | 0

Answered
Why is my graph of my falling object going random?
Instead of using a*t for the instantaneous speed, you need to compute the speed at the time step and increment the current speed...

13 years ago | 1

| accepted

Answered
I want to define a square in a matrix
>> n=6; % overall size s=4; % size of square r=1; c=1; % row,column upper left corner A=zeros(n); ...

13 years ago | 0

| accepted

Load more