Answered
How can ı set initial value about for statement ???
Can't change the loop index variable that controls the loop inside it -- see the following demo-- >> for i=1:4,disp(['befor...

12 years ago | 1

| accepted

Answered
how can call a result used inside a function?
Only by adding _s_LS_ as an additional output to your function *simss* can you pass it back up to the calling function's workspa...

12 years ago | 1

Answered
Could anyone explain the code for me ?
_...Can you make up some example..._ See the FAQ <http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3...

12 years ago | 0

| accepted

Answered
how to sum matrics inside a cell array?
One way, seems should be better but it's still first cup o' coffee this morning... >> R={rand(2) rand(3)} R = [2x2 d...

12 years ago | 1

Answered
How to sum data
Easiest will be to augment the header row w/ all values wanted. If do so, then >> raw_headers={'D' 'A' 'D' 'B' 'D' 'D' 'C'...

12 years ago | 1

Answered
How to subtract an (n by m) matrix from an (n by m) by k matrix without looping?
>> a=eye(2); >> b=rand(2,2,2) b(:,:,1) = 0.3500 0.9275 0.2871 0.0513 b(:,:,2) = 0.5927 0.8384 ...

12 years ago | 1

| accepted

Answered
How can I use Regress Function to fit a line to an irregular line?
Look at John d'Errico's package <http://www.mathworks.com/matlabcentral/fileexchange/24443-slm-shape-language-modeling>

12 years ago | 0

Answered
polyfit fails with easy datafit
>> x = -1:0.001:+1; y= -10*x.^2 +5 - 0.1*(t)+rand(size(t))*0.001; Undefined function or variable 't'. >> ??? what's t?...

12 years ago | 2

| accepted

Answered
issue with a while loop
You've got the *while* operating until BAC<=0.08 by adjusting _Hrs_ but one can take the expression BAC=BAC-(Hrs*.0140); ...

12 years ago | 1

| accepted

Answered
Listener ignores some part of the code and creates unwanted figure
I don't do GUIs so anything specific to that is out of scope, but... axes(handles.axes1); plot(handles.axes1, D_son); xli...

12 years ago | 0

Answered
How can I save a column in already saved matix in .dat file in Matlab
_In an assignment A(I) = B, the number of elements in B and I must be the same. q(i,:)=[k2 l2];_ You've got a bunch of differ...

12 years ago | 1

Answered
How to convert a char array into a double array?
>> v=str2num(char(cell2mat(Y))) v = 1.0e+05 * 1.4743 0.0000 0 >> v(2) ans = 3 >> But, why do...

12 years ago | 1

Answered
How can i break out of my while loop
Try the following demonstration... t3min=3/60/24; tstop=now+t3min; while now<tstop disp(datestr(clock)) pau...

12 years ago | 0

Answered
How to use variable of function in the main program
_... I call a function [a,b,c]=func(data),..._ So, then you have _a_ in the calling workspace (as well as _b_ and _c_); so yo...

12 years ago | 1

Answered
Change of data format
Read the two files and convert to Matlab *datenum* datenums... 00Z01JAN1948 0.00579036 Format for first would be fm...

12 years ago | 1

| accepted

Answered
how can i pick out the peaks which I have already detected.
delt=1.5/dt; % the delta either side; dt is sampling time locplus=round(locs+delt); % the bands about th...

12 years ago | 1

Answered
Use character 'dot' within file names using sprintf
No can do...the OS interprets the name according to its rules -- and the rule in common OS of the day is that the dot signifies ...

12 years ago | 1

Answered
How can I estimate the time required by textscan and the size of the output?
Don't know that there is any metric to predict run time other than testing as it's so dependent upon the machine characteristics...

12 years ago | 1

Answered
Save a cell array into a .txt file
See Example _Exporting a Cell Array to a Text File_ under doc fprintf

12 years ago | 1

Answered
I want to read only the numbers from the text file between a range ( were the start and end differs constantly from one txt file to another)
Complete comments in one place... Or, simply read the full file in as text and eliminate the lines unwanted in memory. May we...

12 years ago | 1

| accepted

Answered
How to set up a value limit to measure a waveform
a) find((max(w)-min(w))<Limit,1) b) find(abs(w)<Limit,1) _w_ is the waveform, _Limit_ is your setpoint/compariso...

12 years ago | 0

Answered
Effect of hold command on plot axes
Yes, setting hold on before plotting tends to foul things up -- why would you do that, anyway? The problem with the *set* com...

12 years ago | 1

Answered
Multi-line x-tick label MATLAB bar graph
Tick labels don't have TeX interpreter so no can do w/ them. Use *text* instead...altho you might search File Exchange for any e...

12 years ago | 1

| accepted

Answered
Strange graph artifact when performing diff() of a high order
*diff* is the simple differential between adjacent points; when you begin subtracting values one after another, loss of precisio...

12 years ago | 1

| accepted

Answered
How do you convert Month/Day to Julian Day?
>> dn=datenum(2008,1,[1:2:400].',0,0,0); % make up some date nums >> d=dn-dn(1); % get the day fr...

12 years ago | 0

Answered
Sort Stocks into Portfolios based on their return
Before *histc* fixup the _EDGES_ vector... >> v= [-0.045 -0.034 -0.03 -0.01 0 0 0.01 0.023 0.03]; >> v(diff(v)~=0) ans = ...

12 years ago | 1

Answered
convert time axis set in 10 day cycles to days?
Presuming from the format it is year.fractionaldays >> diff(t) ans = 0.0271 0.0272 0.0271 0.0272 ...

12 years ago | 0

| accepted

Answered
merge cells into a single one
c={cell2mat(c)}; _...h={1:3; 10:20; 4; 100:105}_ Well, you didn't say that in the original. But the answer is the same ...

12 years ago | 0

Answered
Variable not recognized outside a loop
v=1; for z=1:length(rc) for j=1:length(r) for i=1:length(n) for k=1:length(d) for l=1:lengt...

12 years ago | 0

Answered
interpolate text file data onto different time axis
As the other Michael says, "Houston, we have a problem!" How do you want these data to line up with each other? How does t...

12 years ago | 1

| accepted

Load more