Answered
Plotting distance of each point in a grid from a mean
M=size(Xtr,1); N=size(ttr,1); mnXtr=mean(Xtr(Xtr~=0),:); [X Y]=meshgrid(linspace(-0.5, 1.0, M),linspace(-0.5, 1..0, N...

8 years ago | 0

Answered
Using interp1 with multiple data that meets criteria - Looking to have interp 1 return the max value
Your example code returns ix=4.5; interp1(DATA(:,2),DATA(:,3),ix) ans = 6.0309 rather than 4.5; that result wou...

8 years ago | 0

Answered
Plotting multiple graph in same graph
... for j = 1: 2 : size(READ,2) c = c+1; clf ... Well, you wipe out everything up to here--if ...

8 years ago | 1

| accepted

Answered
How to perform FFT on a signal with a 5 Hz frequency resolution?
The FFT resolution is based on the length of the data sample and the sample rate and the length of the computed FFT. If ...

8 years ago | 1

| accepted

Answered
How to connect lines of a scatter plot?
Well, the simple way is to do the plot of the data without the NaN elements; the builtin behavior is to ignore NaN and that's no...

8 years ago | 0

Answered
How to show the values are constant inside a cell array
Presuming interpreted the meaning of "constant" in each cell, >> c{:} % small demo cell array first,last ...

8 years ago | 0

Answered
How can I plot a Pareto Chart (Y-axis= Qty VS. X-axis = Part Description) for the attached Excel data table?
A={1 30 'ARD'; 2 25 'CDE'; 3 22 'BTS'; 4 10 'RSD'; 5 5 'TSE'; 6 4 'DMP'; 7 3 'MTR'; ...

8 years ago | 1

| accepted

Answered
Calculate error bar and plot them
<https://www.mathworks.com/matlabcentral/answers/379570-how-can-i-place-my-error-bar-in-separate-bar-center#answer_302325 Answer...

8 years ago | 1

Answered
how to remove image extension so that only numbered name can be stored in a database
n=sscanf(fname,'%d.jpg') or [~,name]=fileparts(fname); n=str2num(n);

8 years ago | 0

| accepted

Answered
I have a time series daily data points from Jan-1-2007 to March-31-2011 which is 1642 data points. How to plot the CDF of the same?
Because |ecdf| returns the percentiles at the _*unique*_ locations in the input vector returned in the optional second output va...

8 years ago | 0

| accepted

Answered
Spliting a n-by-3 Array into several different arrays.
|v| is _not_ a vector but an array. Star's code works on a vector; would be painful to extend to an array I think, as is. _B...

8 years ago | 0

| accepted

Answered
Repeat for-loop from the beginning after recalculating values
Directly addressing the Q?, here's a basic function to do the removal-- function x=thompsontau(x) % Return array x w/ ou...

8 years ago | 0

| accepted

Answered
how to specify the X and Y ticklable?
|X,YTick| and |X,YTickLabel| are integrally coupled together -- you must label every tick with a label (or a blank string if don...

8 years ago | 0

Answered
How to animate line on polar axes plots
polar coordinates are "red-haired stepchildren" in Matlab, for sure. I've not played with the new(ish) |PolarAxes|, but I t...

8 years ago | 1

| accepted

Answered
Repeat for-loop from the beginning after recalculating values
The first loop can be eliminated entirely--use the Matlab array syntax: x_31=mean(P31,'omitnan'); SDP_31=std(P31,'om...

8 years ago | 0

Answered
How to avoid using dynamic variables?
Good on ya' to recognize the futility of the approach! :) See doc splitapply for the general utility function to ap...

8 years ago | 0

Answered
2 different markers in loop, show both when applicable
if isequal(VEI4lat,[0]) == 0, is equivalent to if VEI4lat~=0 and the block is empty so nothing ever happens for any...

8 years ago | 0

| accepted

Answered
Add secondary semilogx axis to linear plots
OK, I _think_ this is close if I understood correctly... % make up some dummy data that sorta' looks similar... phi=-2:2...

8 years ago | 1

| accepted

Answered
Insert xticks in bold in existing xticks
You've got to write the same number of tick labels as ticks and place the non-automatic text in the locations desired, explicitl...

8 years ago | 0

Answered
Row-by-row analysis after establishing a threshold value
A=[0.55 0.45 0.55;0.65 0.75 0.85;0.35 0.95 0.45;0.85 0.15 0.25;0.35 0.25 0.15;0.45 0.45 0.35]; T=0.5; iUnOv=all(A<T,2) |...

8 years ago | 0

Answered
I'm getting the following error when I try to run some function m-files: Undefined function or method 'eig' for input arguments of type 'intval'.
>> doc eig ... Input Arguments A — Input matrix square matrix Input matrix, specified as a real or comple...

8 years ago | 0

| accepted

Answered
How do I remove paired data in a matrix?
A(any(A<0,2),:)=[]; Or, vice versa, keep the wanted-- A=A(all(A>=0,2),:); % keeps 0 as +ive Look up |logical ind...

8 years ago | 1

| accepted

Answered
Is there a (convenient) way to find out which Toolbox you need for code written by somebody else in the past?
Unfortunately, "no, not really". One of the real problems in MATLAB design is namespace pollution and with the tremendous proli...

8 years ago | 0

Answered
Concatenate variables from multiple files to just one single matlab file
d=dir('station*.mat'); % return the list of files n=length(d); % number files...

8 years ago | 0

Answered
Adding values of each element of cell array
Don't "double-up" cell indexing; makes dereferencing much more complicated than need be... Define x as x{1,1}=[0.8,1.4];...

8 years ago | 0

| accepted

Answered
How to pull out numbers after specific string in txt file?
That's a complex file and there are, it appears, multiple sections; you'll have to decipher just how to determine which one is t...

8 years ago | 0

Answered
Push button for open tecplot
I haven't used TecPlot in years, but there are quite a lot of things it can do that would be extremely difficult to do in Matlab...

8 years ago | 0

Answered
How to store each iteration value and plot it ?
Preallocate for |L2| and keep and increment an index inside the loop and store into an array L2=zeros(N,1); ...

8 years ago | 0

| accepted

Answered
Filling an area between max and minimum lines on a plot
See if <https://www.mathworks.com/matlabcentral/answers/414852-how-to-plot-an-area-limited-by-two-functions#answer_332770 Answer...

8 years ago | 1

| accepted

Load more