Answered
Multiple x-axis for a single plot
Maybe shoulda' searched the documentation first... :) <http://www.mathworks.com/help/matlab/creating_plots/graph-with-multipl...

10 years ago | 0

Answered
Excel equation to Matlab translation????
R=0; if sum(E) d=E-C; % temporary difference R=sqrt(dot(d,d)/51); end or R=sqrt(sum((E-C).^2)/51); ...

10 years ago | 0

Answered
How to divide the space under a normal probability density function (pdf) into equal probable intervals?
>> p=[0:0.10:1].'; >> mu=2; sigma=1; >> x=norminv(p,mu,sigma); >> disp([p x]) 0 -Inf 0.1000 0.7184 ...

10 years ago | 0

| accepted

Answered
Averaging multi-dimensional arrays across several dimensions at once
Only thing that comes to me at the moment is to use a temporary... mX=X(1,1,:,:,:); mX=mean(mX(:)); it _might_ help a...

10 years ago | 2

Answered
Why is this code not allowing me to save a text file using Matlab?
What's wrong with your code is you didn't test the return value from *fopen* before trying to use the result...maybe you're tryi...

10 years ago | 0

Answered
To RESHAPE the number of elements must not change?
All the code is superfluous and a red herring to wade through excepting for the function containing the error.. function [I...

10 years ago | 0

Answered
How to set the step size in z axis?
To keep the autoranging limits if they're ok and using a tick spacing of 100, but you want 200, simply ztk=get(gca,'ztick')...

10 years ago | 0

Answered
How to use textscan to properly read a csv file?
Well, you don't say which columns, but it's simple enough...and actually, if after the header/text lines it is all numeric then ...

10 years ago | 1

Answered
Datenum comparison not behaving
Bad input format string... 'MM' is minutes, 'mm' is months... >> datenum('20160113','yyyymmdd')<datenum('20160512','yyyymmd...

10 years ago | 0

Answered
Problem when extracting data from string array!
... row_one=strcmp(data_text(1,:),''); row_one=data_text(1,~row_one); You're searching for an empty character in the ...

10 years ago | 0

Answered
How to plot a single data point at a specific location?
Alternatively, stairs(x,y)

10 years ago | 0

Answered
Fastest way to have a matrix with intersected elements only between matrix and array
Close >> a.*ismember(a,v) ans = 0.1000 0 0.3000 0.3000 0.5000 0 0 0.1000 ...

10 years ago | 0

Answered
I have a matrix A=[M;N;O] where M,N and O are also matrix of 7*7 .How should I multiply these type of two matrix which cantains matrix as an elements it self?
'Pends on what kind of multiplication you mean...element-wise or matrix. C=A.*B; % element-wise size(C)==[21,7] C=A*B.'...

10 years ago | 0

Answered
Is there a way to know from fig file which code file created it?
No. Bestest you can do is create a script file that will reproduce the figure from the internal data, but it wouldn't be able t...

10 years ago | 0

Answered
Parsing Strings with Values Missing
Actually, since the values are regularly spaced, simply create a format string for the ones you want...I picked the first and th...

10 years ago | 0

| accepted

Answered
How to read string/numeric line from file, and parse out one number?
Many ways, one would be ... fmt=['%*f %*s' repmat('%*f',1,3) '%f']; % skip number/string/3numbers, read value v=ce...

10 years ago | 0

| accepted

Answered
Xtick location is not correct
You'll have to set the two axes xlim ranges to a consistent set of ticks and range. It's difficult to interpret but I guess bot...

10 years ago | 0

Answered
transpose of a complex array
See doc transpose I've always thought it peculiar too, that TMW chose the "dot" version for the array transpose and the ...

10 years ago | 1

Answered
plotting 4 variables in same graph
plot(sd,[h;sa;a].') legend('H','SA','A') xlabel('SD') Finish 'salt to suit'...

10 years ago | 0

| accepted

Answered
How to use different markers for different X,Y pairs?
Can't use the named names multiple times in the same call, per the documentation: _"Property name-value pairs apply to all the l...

10 years ago | 0

Answered
Add dimension to YTickLabel
Use *text*. You'll have to 'spearmint to find the proper coordinates hT=text(1.75,1.03E6,'[GWh]'); looked pretty close...

10 years ago | 0

Answered
Problem with importdata, unable to open file.
For reasons only known to Gates and Allen, MS *dir* returns the two '.' and '..' entries which aren't files (nor anything else u...

10 years ago | 0

| accepted

Answered
How to rename files in a batch process using arrays?
movefile(Paper %.doc,Oldsequence(i),Paper %d.doc,newsequence(i)); is illegal syntax, the '%' sign introduces a comment in t...

10 years ago | 0

| accepted

Answered
vectorization of piecewise defined function
Well, as homework it's not kosher to just provide the solution; that does you no good in learning... HINT: type doc 'lo...

10 years ago | 0

Answered
How does this Mandelbrodt Set code work?
Not to give it away _too_ easily, see <https://www.bowdoin.edu/~dfrancis/askanerd/mandelbrot/ <Mandelbrot>>. You should underst...

10 years ago | 0

Answered
How to insert multiple legends in a figure
From help legend ... You can only display one legend per axes. ... ... So you can't do what you've asked for ...

10 years ago | 0

Answered
How to plot two graphs generated by different files together on the same axis?
You'll have to modify the function to allow you to plot the second on the existing axes or write a top level function (or do it ...

10 years ago | 0

Answered
How to pick data from one set with a condition from another?
1. Assume the window position is in an array _posn_; use whatever is your variable, obviously. iOpen=[false diff(posn)==1];...

10 years ago | 1

| accepted

Answered
Extracting rows from one matrix and place it into another matrix based on a certain condition using a while loop
K=kurtosis(X(:,3); % only test for Z so just compute it B=[]; % accumulator for B while K...

10 years ago | 0

Load more