Answered
Impose daily variability on monthly meteorological data
OK, w/o a lot of effort a first pass of the basic idea might be sotoo... rain=importdata('rain.dat'); % the data file w/...

12 years ago | 0

Answered
general question on format text and notification
1) A) Highlight the code and press the {}Code button, or B) insert 2 blank spaces at beginning of line. If you do A) ...

12 years ago | 1

Answered
finding average from 20 text file data based on the matched row from every single text file
files = dir(fullfile(Directory,'*.txt','B%d')); ... for i = 2:numel(Names) files= dlmread(fullfile(Directory,Names{i}))...

12 years ago | 0

Answered
How can I find the last element amongst a set of grouping variables?
ix=[find(diff(x(:,1));length(x)]; % index of breakpoints plus last subset=x(ix,:); % the selected poin...

12 years ago | 0

Answered
How to create a text file from grep output
If that's the way you're intent on going about it, just use the bang operator "!" and submit the command to the OS. There are W...

12 years ago | 0

Answered
How to iteratively increase number in filename?
list=dir('*.dcm'); for m=length(list):-1:1 [~,name,ext]=fileparts(list.name{m}); basename=name(1:end-1); % stri...

12 years ago | 0

| accepted

Answered
Combine rows generated in for loop
Wait until you're done, then use the "magic" of Matlab internal storage order and rearranging...let's do a small example to show...

12 years ago | 0

| accepted

Answered
Horzcat error with num2str in disp function.
Because _A_ is 3x3 whereas the string is 1xlength(). Use disp(['The values in A are' num2str(A(:).') '.'])

12 years ago | 0

Answered
How to: simplify statistical commands into fewer lines of code
_... [compute] mean, median, maximum, minimum, and standard deviation values for each category [in which each[ corresponds to it...

12 years ago | 1

Answered
why? the number of elements in B and I must be the same
The preallocation is simply before the loop add X_ICOMP=zeros(10,1); % preallocate for later population and similar for...

12 years ago | 0

Answered
How I can save the command that I wrote it in command window?
*Save* saves the _values_ of variables, not the commands by which you created them. Easiest way to save a sequence of your wo...

12 years ago | 2

| accepted

Answered
Problem in data interpolation over different grids
What I was trying to do was to interpolate the observations on the model grid by using interp2, but I keep failing. Following ...

12 years ago | 1

Answered
How to assign a label to each bar in stacked bar graph?
>> y=rand(4,5)*10; >> bar(y,'stacked') >> job=num2str([1:5].','Job %d'); >> legend(job,'location','northwest') >> <</m...

12 years ago | 2

Answered
Validate number in function from user input
*nargin* checks for number of arguments _into_ the called function; your function doesn't have room for any so that whole clause...

12 years ago | 0

Answered
problem with simple "flip" function
The function isn't *flip*; they're separate functions *fliplr* and *flipud* for row/column vectors in particular.

12 years ago | 2

| accepted

Answered
Exporting matrices as text file
>> fprintf('%s,%s,%d\n',A,B,C) Picked,P,100 >> fid=fopen('yourfile','w'); fprintf('%s,%s,%d\n',A,B,C) fid=fclose...

12 years ago | 0

| accepted

Answered
plot time values, datetick
Add an arbitrary start yr/mo/day field for input to *datenum*. Or, if the timestamps are all precisely 15 second intervals you ...

12 years ago | 0

Answered
Finding non-unique values in an array.
If the column of interest is y, then u=unique(y); % the unique values [n,bin]=histc(y,u); % count how many of e...

12 years ago | 1

Answered
How to have MatLab put input numbers into an array?
You'll have to read the returned input as a string rather than an expression which is the default behavior of *input* numbe...

12 years ago | 0

Answered
How can I interpolate 3 columns of data independently of each other?
From help interp1 ... Vq = interp1(V,Xq) assumes X = 1:N, where N is LENGTH(V) for vector V or SIZE(V,1) for ar...

12 years ago | 0

Answered
Xlswrite into one column
Fastest will be to collect the array and do the write in "one swell foop"... xlswrite('yourExcelFile',val(:)) NB: the (:...

12 years ago | 0

Answered
How to write rows to a csv based on the preceding data?
To find the missing unless you have some other a priori knowledge (_why_ it's missing, say) that is useful to find the location ...

12 years ago | 0

Answered
find 2 common values of 3 in row matrix?
>> for i=1:2:size(A,1),cmn=intersect(A(i,:),A(i+1,:)),end cmn = 2 3 cmn = 6 7 >>

12 years ago | 0

| accepted

Answered
How can I choose multiple File by using UIGETFILE
... rgbimage=uigetfile('*.jpg,*.bmp','Choose Host Images','*.jpg'); imshow(rgbimage); _...uigetfile=('.jpg','Choose Ima...

12 years ago | 0

| accepted

Answered
How can I choose multiple File by using UIGETFILE
... [h_LL,h_LH,h_HL,h_HH]=dwt2(rgbimage,'haar'); img=h_LL; red1=img(:,:,1); green1=img(:,:,2); ... Error in embedd ...

12 years ago | 0

Answered
How to save a vector into cell array?
This error has nothing to do with storing anything into a cell array; it's a syntax problem with the call to *fwd_solve* itself....

12 years ago | 0

Answered
Plot several graphs with differnt sample time in one figure
_...plotyy([x1;x2],[y1;y2],..._ The problem here has nothing to do with *plotyy*, per se, but in Matlab can only have "jagged...

12 years ago | 0

| accepted

Answered
How can I fix a "Subscripted assignment dimension mismatch."
First, eliminate all the spurious code that has no bearing on the problem...the plotting and such is of no use; is simply distra...

12 years ago | 0

Answered
How can i read text file?
Read doc textscan and the examples, carefully. There are sufficient examples and info there... You seem to have mixe...

12 years ago | 0

| accepted

Load more