Respondida
Efficient Weighted Moving average
N=5; yavN=conv(v(:,2).*v(:,3),ones(1,N)/N,'valid'); discarding the zero-padded end values. See doc conv % for oth...

más de 9 años hace | 2

Respondida
financial time series obiect: get a column by name string?
Again, similarly to the other question, relate it to the _struct_; I didn't find the similar documentation under the financial T...

más de 9 años hace | 0

| aceptada

Respondida
str2func vectorize input x1, x2 to x
You didn't follow your previous successful pattern... f1 = str2func(['@(x,u)' str1]); as written is the concatenation of...

más de 9 años hace | 1

| aceptada

Respondida
Finding and counting numbers from one matrix in another
Is fairly simple, yes, but have to think about it a while to find "the Matlab way"... :) There's always another way, but what...

más de 9 años hace | 2

| aceptada

Respondida
Duplicate file name when using textscan
There's _always_ a reason, yes... :) However, we can't tell what that reason might be for certain but the crystal seems fairl...

más de 9 años hace | 0

Respondida
How to remove rows contain 0 in matrix
OK, had some time to try to deduce how the output was produced...other than there's an error in the original in that the first r...

más de 9 años hace | 0

Respondida
How to search in excel file ?
In general you'll be better off reading the Excel file and doing any search/selection in memory discarding what you don't need i...

más de 9 años hace | 0

Respondida
How to extend horizontally this inputdlg window?
Don't see a way programmatically, TMW didn't expose the rest of the control properties thru the provided interface, unfortunatel...

más de 9 años hace | 0

Respondida
How to label x and y axis in case of subplots
Post comments: for j=1:20 % note filled out the array fully here hAx(j)=subplot(5,4,j); % save the sub...

más de 9 años hace | 2

| aceptada

Respondida
Merging Table with Duplicate Dates
Almost same solution as above...the only real significant difference is that |*strcmp*| is cell-aware so don't need |*cellfun*| ...

más de 9 años hace | 1

Respondida
Strange output with function sortrows
No .mat file attached, try again. I'd venture that whassup is floating point roundoff so that all those "identical" values a...

más de 9 años hace | 0

Respondida
How to remove rows contain 0 in matrix
The first part seems pretty easy, but I've no klew how you actually got _B_ from what's left...in fact, there are several elemen...

más de 9 años hace | 0

Respondida
Place a word into a position in a Matrix
Well, we can't always have what we want...life's just unfair that way. Only way you can do so is to make the array a cell arr...

más de 9 años hace | 1

Respondida
Remove letters tabs and spaces from a string with numbers and letters while creating a vector with the remaining numbers
Actually, to my surprise *textscan* did a better job than I expected... >> v=mat2cell(textscan(fid,['%*s' repmat('%f',1,11)...

más de 9 años hace | 0

Respondida
Numel with loop for+if condition
*numel* isn't the builtin you're looking for here, it's the product(size(A)) --> 36, not 6. But, you "don't need no steenkin'...

más de 9 años hace | 2

| aceptada

Respondida
dimension mismatch with growing char matrix
>> num2str([10 1].','P%03d') ans = P010 P001 >> *numstr* is vectorized. To do with individual conversion again use ...

casi 10 años hace | 1

Respondida
Add elements of a vector
Not sure what you really mean here, but what about *cumsum*, maybe??? >> z=1:10; >> cumsum(z) ans = 1 3 6 ...

casi 10 años hace | 1

Respondida
Undefined function or variable when using fprintf? I have already defined what the variable is however when i run the code it doesn't work.
_L_ is undefined for Case D>0...and, as written the last three *IF* statements will all be executed every time irrespective of t...

casi 10 años hace | 0

Respondida
How to process specific data from multiply Excel files?
_"...Is there a way to process the data in a different way?"_ Of course! :) First, either create a file containing the li...

casi 10 años hace | 0

Respondida
fprintf to txt too slow, anyway to accelerate it?
A=[a;b]; % append to one array for convenience A(A==badValue)=nan; % replace the bum values with NaN csvw...

casi 10 años hace | 0

| aceptada

Respondida
Extract data from a non-rectangular text file, efficiently
Close, but the first record is numeric, not string... >> n=cell2mat(textscan(fid,'%f',2,'collectoutput',1)) n = 50 ...

casi 10 años hace | 0

| aceptada

Respondida
How to Assign a Struct Field to a Matrix?
'Cuz you must have an already-existing _G_ variable... >> g=pi; >> g(1,:)=A.B.C Subscripted assignment dimension mism...

casi 10 años hace | 1

| aceptada

Respondida
Convert a 3d matrix mat file to multiples 2d CSV files.
Against my better judgement, but Walter says I preach too much... :) Presume array is _x_ in memory-- for i=1:size(x,3) ...

casi 10 años hace | 1

Respondida
Quit matlab from script without "Attempt to restart MATLAB? [y or n]"
Check Confirmation Dialogs Prefereces for "Confirm before exiting MATLAB" setting and whether is a *finish.m* file in the workin...

casi 10 años hace | 1

Respondida
How do I customize xticks on plots?
x = linspace(0,100,101); y=x+2; plot(x,y) xt=[24 95]; % set the desired tick location values set(gca,'xtick',xt,'...

casi 10 años hace | 0

| aceptada

Respondida
Reading from a variable length text file
Will show another approach based on previous comments... >> data=textread('sushim.csv','%s','delimiter','\n','whitespace','...

casi 10 años hace | 0

Respondida
My if x ~= y statement is not working
*==* is precisely that to the LSB; undoubtedly the values in _E_load2_ in question are close but not identically equal. See the...

casi 10 años hace | 1

| aceptada

Respondida
How to extract rows from a text file with a specific start?
"Dead-ahead" solution... fid1=fopen('yourfile'); fid2=fopen('newfile','w'); while ~feof(fid) l=fgets(fid); ...

casi 10 años hace | 1

Respondida
Reading from a variable length text file
*importdata* is _almost_ smart enough-- >> dat=importdata('sushim.csv'); dat = data: [8x14 double] textda...

casi 10 años hace | 0

Respondida
legend problem with handles
I'm betting that the result of the *set* aren't working as intended; you've got a 5x5 array for the _markers_ array that at leas...

casi 10 años hace | 0

| aceptada

Cargar más