Answered
Histogram of 2 sets of data in same plot, different columns, same bin
bar([p1;p2],[n1;n2],'grouped') doc bar % look at example under "Bar Graph Styles"

12 years ago | 1

Answered
Fortran to Matlab GOTO
First branch; similar for the rest altho may be more rework and need some other refactorization than just simple IF...ELSE...END...

12 years ago | 0

Answered
How do I import CSV files using csvread?
As the doc says, _...All data in the input file must be numeric. dlmread does not operate on files containing nonnumer...

12 years ago | 0

Answered
How do I import CSV files using csvread?
m{i}=textread(d(i).name,'','headerlines',5); Gotta' have an empty format field for *textread* to not need multiple outputs...

12 years ago | 0

Answered
Integration of velocity not working, creating zeros
*trapz* is an trapezoidal _*INTEGRATION*_ routine, not differentiation doc trapz doc diff

12 years ago | 0

| accepted

Answered
Read single "cell" containing partly text and numbers
Yeeeech! That's one of the worst formatting of output to parse I've ever seen. Who dreamed that up and why???? _X-POS/Y-POS...

12 years ago | 0

Answered
How can i extract different rows of a matrix whose first column is same.. ?
day1=test(test(:,1)==1,:); Look up "logical addressing" in the documentation; it's a fundamental concept in Matlab

12 years ago | 0

Answered
How do I return the first instance the value goes below 0 from a specific cell start point?
Ah, that's more easily understood what looking for-- find(x(fz:end),1,'first') will return the first _nonzero_ location ...

12 years ago | 0

Answered
Read single "cell" containing partly text and numbers
The brute-force way... >> fmt='%*s %*f %*f %f*x + %f'; >> fid=fopen('lars.txt','r'); >> cell2mat(textscan(fid,fmt,'he...

12 years ago | 0

| accepted

Answered
How can I repeat a function i times for each i-th value of a vector?
combined_result=arrayfun( ... @(rr) defintAltadis(cdsAltadis, zerotermstruc, deffreq, spreadfreq, rr), ... vec...

12 years ago | 0

| accepted

Answered
how to plot with line ?
OK, starting over -- I looked at your plot and see you really didn't use arrows at all--that makes it _much_ simpler. Why TMW c...

12 years ago | 1

Answered
How do I return the first instance the value goes below 0 from a specific cell start point?
[y,z] = size(mydata{i,1}); firstz = find(mydata{i,1}(:,5)== 0,1,'first'); % first zero in the column fz = firstz...

12 years ago | 0

Answered
Hi, i want to plot two columns of values of data from excel, and here is my code but it is saying Index exceeds matrix dimensions.
dat1(j,:)=sscanf([E{(j+1)*10,1}],'%E9').'; In [E{(j+1)*10,1}] you've multiplied the index by 10, not the value; yo...

12 years ago | 0

Answered
how to plot with line ?
y1=[wl.NIR(3,t1); -0.2*ones(size(t1))]; % and y ??? Attempt to reference field of non-structure Why did you put the ...

12 years ago | 0

| accepted

Answered
Hi, i want to plot two columns of values of data from excel, and here is my code but it is saying Index exceeds matrix dimensions.
_... or draw both in one and the same graph_ doc hold plot(x1,y1) hold on plot(x2,y2) or, plot([x1 x2], ...

12 years ago | 0

Answered
How to reorder the rows by sorting the elements of column in ascending order?
for c=1:3 is(1)={sortrows(id,i)}; end using a cell array to hold results; use a dynamic named structure field if ...

12 years ago | 1

| accepted

Answered
How to transform [1:15] to [01 02 03 ... 15]
>> num2str([0:4].','M%04d') ans = M0000 M0001 M0002 M0003 M0004 >>

12 years ago | 6

| accepted

Answered
Hi, i want to plot two columns of values of data from excel, and here is my code but it is saying Index exceeds matrix dimensions.
>> [a,b]=xlsread('xl.xls'); >> whos a Name Size Bytes Class Attributes a 0x0 ...

12 years ago | 2

| accepted

Answered
how many number in col have certain number
sum(x>0)

12 years ago | 1

Answered
How do I skip a blank file?
Most solid answer I think would be to wrap the read in a *try...catch* block because I'm thinking there's virtually no way from ...

12 years ago | 2

Answered
the reason of why there is a warning like that?
<http://www.mathworks.com/matlabcentral/answers/99745-why-do-i-get-warning-message-matrix-is-close-to-singular-or-badly-scaled>

12 years ago | 0

Answered
how to avoid 'index exceeds matrix dimension' error?
filter=[0.25 0.5 0.5 0.5 0.25; ... ... 0.25 0.5 0.5 0.5 0.25]/16; % Performs Smoothing for v= 3:m ...

12 years ago | 0

Answered
find function with cells
find(A=='d')

12 years ago | 0

| accepted

Answered
How to mark different values with different colors and markers
Basics are as follows-- fmt=['%.2f + %.2fi']; % build a format string for complex scatter(Z(:,1),Z(:,2)) % plot the p...

12 years ago | 0

Answered
Filtering max values within every 3 hours of data
An alternate approach... >> dat=circshift(dat(:,1:2),-1); % place the first of groups of three on first row >> ddat=ce...

12 years ago | 1

Answered
How to mark different values with different colors and markers
*plot* creates a line object and the above are all global properties of the line. To put them on as differently you'd have to...

12 years ago | 0

| accepted

Answered
fopen error too many argument
If the file is returned by *dir* then it _does_ exist unless you're trying to process the directory entries as well as the files...

12 years ago | 1

| accepted

Answered
histogram maximum but not as bin border
Use either *hist* or *histc* with the optional vector of bin centers/edges depending on which way you want to specify the bins. ...

12 years ago | 0

Answered
How do I import CSV files using csvread?
Looks like should work presuming your filenames are ok but I'd do it _slightly_ differently. Try sotoo... d=dir('*.csv')...

12 years ago | 0

| accepted

Answered
fopen error too many argument
filedir=dir(dirpath) for k=3:length(filedir) % I start the loop from 3 to avoid the subdir . and .. fid=fopen(filedir(...

12 years ago | 1

Load more