Answered
Moving window of 100 points with 20 points overlap.
Nfilt=20; b=ones(1,Nfilt)/Nfilt; % weights magFiltered=[nan filter(b,1,mag)]; % weight average (includes e...

10 years ago | 0

| accepted

Answered
Count numbers for a specific string, in a cell with string names and numbers
If have the Stat Toolbox, use nominal variables and *grpstats* >> users=nominal(departusers(:,1)); % the department n...

10 years ago | 0

Answered
Pass the content of a variable to a .bat file from matlab
Use *system* instead for command form to evaluate variables in building the command string. *!* ("Bang") interprets everything ...

10 years ago | 0

Answered
legend for plotyy causes axes problem
There are multiple axes created by *plotyy* and *hold* operates on only one at a time (and, disappointingly, won't accept a vect...

10 years ago | 1

| accepted

Answered
Why does 10^61 not equal 1e61 in MATLAB?
>> for i=3:40, if 10^i~=eval(['1E' num2str(i)]),disp(i),break,end,end 29 >> I may be wrong but I think most languag...

10 years ago | 0

Answered
How to replace a number with 0 in an array
nCol=3; % say, for the particular column x(x(:,nCol)==0.5)=0; % turn to zero *NB:* While 0.5 is exac...

10 years ago | 2

| accepted

Answered
Counting all the numbers above a certain threshold in a matrix, keeping each event seperate.
I'm not positive re: the comment about value being same for each column, either, but the given the prhasing I'm guessing it's re...

11 years ago | 0

| accepted

Answered
Datetime with variable format
I'm frankly surprised the above doesn't give a syntax error on the duplicated named input, but guess it likely just takes the fi...

11 years ago | 1

Answered
How to take seasonal average of monthly values?
Depends on storage order...if 10x12 (years x months), then Tseas=mean(reshape(T.',3,[])); If it's already in column order...

11 years ago | 0

| accepted

Answered
How to write and save in an excel file?
I'd suggest a few changes-- XLfile = dir(); Why not use wildcard to only get .xls? files? Then can get rid of the other...

11 years ago | 0

Answered
I am currently attempting to use the find function in Matlab and can not get it to work. Help?
You're testing only for the one case in which the score is precisely 0.5, for the *disp* statement _*not*_ that the score is a m...

11 years ago | 0

| accepted

Answered
Matlab fractions into binary fractions help
>> i=[1 1 0 1]; f=[1 0 0 1 1 0]; >> sprintf([repmat('%d',1,length(i)) '.' repmat('%d',1,length(i))],i,f) ans = 1101.10011...

11 years ago | 0

Answered
delete some columns in A and the same columns in another matrix C
>> idx=all(isnan(A(end-1:end,:))) idx = 1 1 0 0 >>

11 years ago | 0

Answered
I'm calling a function which sets persistent variables. Is there anyway to access those persistent variables outside the function?
Newp, no can do. If you _could_ modify the function have it *assignin* the base workspace to a local variable but if you can't ...

11 years ago | 1

Answered
Read and seperate CSV data
Your basic problem is the file was created as a text file of multiple strings which include the comma delimiters within them, no...

11 years ago | 0

Answered
I am using textscan to extract data with an unknown number of columns.
Presuming the file is comma-delimited as shown in the example, it's pretty-much trivial--while it's been put into "redhaired-ste...

11 years ago | 0

Answered
q(a,:)=0; means
See <http://www.mathworks.com/help/matlab/math/matrix-indexing.html matrix-indexing> Or, try x=rand(4); a=[1 3]; ...

11 years ago | 0

Answered
Operations on consecutive elements of a vector
If'en I interprets your requirements correctly... d=[c(1) diff(c(1:end-1)) -c(end)]; Example: >> c=randi(10,1,5) c...

11 years ago | 0

| accepted

Answered
How to create monthly average from daily data?
As noted in the comment, since the problem is insolvable without having the dates in some form, I'll just assume you can create ...

11 years ago | 0

Answered
Ok I am just trying to display a matrix properly that has small numbers like 8.00e-5 but when i enter it in as a matrix i get .00001 instead of the correct number... any help?
>> format shorte >> x x = 8.0000e-05 8.0000e-04 2.0000e-03 3.5000e-03 4.0000e-03 4.7500e-03 >> doc form...

11 years ago | 0

| accepted

Answered
What's wrong with tied ranks?
Answered in identical thread on newsgroup...short story is your two 0.6 values are similar-enough to print out the same to preci...

11 years ago | 0

Answered
I want to plot the values of each month and the respective year in one line, so basically 34 lines in a plot to show how the values are changing for 34 years
_"...Uyear is a matrix with dimensions 34*12, how can i plot each row of that matrix as a line in a line plot"_ mo=[1:12]; ...

11 years ago | 0

Answered
Fitting Polynomial Curve for 4,000 curves.
Same basic solution as Stephen's above excepting doing the conversion on the front end instead of the latter and having implicit...

11 years ago | 0

Answered
how to extract this data?
As noted above, w/o a file to test, something like fid=fopen('yourfile'); % open file d=cell2mat(textscanf(fid,'','he...

11 years ago | 0

Answered
Question about the legend command
Since it really isn't content of the x,y that you're interested in grouping on, create the grouping variable as (or similarly)--...

11 years ago | 0

Answered
Top x-axis disappeared in plotyy
The subsequent answer buried at the end of the long previous discussion is, I think, so significant I'll repost it here alone-- ...

11 years ago | 0

Answered
how to plot prediction and confidence interval
p = predint(fitresult,x,0.95,'observation','off'); ci = confint(fitresult,0.95); ciup = polyval( ci(2,:),x); cilow = ...

11 years ago | 1

| accepted

Answered
Top x-axis disappeared in plotyy
OK, now we have enough to diagnose the real problem -- turns out didn't need so much but without _something_ that could run to i...

11 years ago | 0

| accepted

Answered
Why do I get a graph without a line when I try to plot the following equation?
Need the "dot" operator on the divide as well as the exponent...as is it's a matrix operator, not element-wise. doc / % fo...

11 years ago | 1

Answered
Linestyle of matrix with plotyy
Use *set* for multiple handles... set(hL1,'linestyle',':') Don't know why TMW didn't add the facility in the methods; if...

11 years ago | 0

Load more