Answered
Generating Plots From Cell Array
This works for me (in *|R2017a|*): dinfo.name = [1,2,3,4]; % Create Structure output = ...

9 years ago | 0

| accepted

Answered
Least square curve fit
I do not have the Curve Fitting Toolbox, so I cannot provide an exact example. However the problem is obvious — the complex val...

9 years ago | 1

Answered
How can we define equally- ranged bins in histogram?
The easiest way is to use *|linspace|*, choose the minimum and maximum values, and select the vector length to be one more than ...

9 years ago | 1

| accepted

Answered
diff(x) is different to diff(fit)
Differentiation has the effect of high-pass filtering your data. This amplifies the noise, because the step-by-step differences...

9 years ago | 0

| accepted

Answered
Can I create multiple stem axes using stem3?
One approach: x = randi(9, 1, 5); % Create Data y = randi(9, 1, 5); ...

9 years ago | 0

| accepted

Answered
Changing Objective Function in fsolve
One approach: y = shell_fcn(args,opt) [B,A] = myfun(args(1),args(2),args(3)); switch opt case 1 y ...

9 years ago | 1

Answered
I've been stuck on this MATLAB question
The *|rem|* or *|mod|* functions are your friends in this problem.

9 years ago | 0

Answered
How to make the number on yaxis of a histfit plot to a probability?
The easiest way is just to recalculate the *|'YTickLabel'|* values, if you only wnat to normalise the y-axis: r = normrnd(...

9 years ago | 3

| accepted

Answered
to plot Magnitude of a system versus angular frequency
The easiest way: s = tf('s'); sys= 1/(s + 2); figure(1) bode(sys) See the documentation on the <https://ww...

9 years ago | 0

| accepted

Answered
Subplot function interfering with appropriate plot display
The impulse and step responses are _defined_ as beginning from *|0|*, and do not exist for negative time. I can’t find *|‘steps...

9 years ago | 1

| accepted

Answered
Plot in for loop
Without your data I can’t completely troubleshoot your code. This should get you started: numcath = size(raw_EM_cath,...

9 years ago | 0

Answered
Filter function doesn't do filtering
I don’t have the DSP System Toolbox, so I cannot run your code. The power spectral density is probably not the best way to ...

9 years ago | 0

Answered
Why is there multiplication by a factor of two when the Fourier transform of a Morlet wavelet is calculated internally?
In a two-sided Fourier transform, the energy at each frequency is divided equally between the positive and negative ‘halves’ of ...

9 years ago | 0

| accepted

Answered
FFT- sound pressure (db) vs time (s)
First, I would convert the decibel SPL values in decibels to the original amplitude values: amplitude = 10.^(SPL/20); T...

9 years ago | 1

| accepted

Answered
i want to find the max element in each row and position of that element in terms of row and column
The *|max|* function is returning the _column_ numbers of the maximum in each row, because you asked it to. If you want to retu...

9 years ago | 1

Answered
Digital Filter Bode diagram by M-file
Use the <https://www.mathworks.com/help/signal/ref/fvtool.html *|fvtool|*> (link) function, or the <https://www.mathworks.com/he...

9 years ago | 1

Answered
Help with code error
One problem is that this loop index should be *|‘jj’|*, not *|‘ij’|*: for jj = 1 : 101 and you are using the lower-case...

9 years ago | 0

| accepted

Answered
How to change line specifications for frequency response?
The Control System Toolbox and System Identification Toolbox graphics functions do not generally allow you alter their propertie...

9 years ago | 0

| accepted

Answered
get a diagonal line in matrix
First, do a left-right ‘flip’ of *|‘a’|*, then use the *|diag|* function: a = [1 2 3; 4 5 6; 7 8 9]; a_disg = diag(flip...

9 years ago | 0

| accepted

Answered
shade area under curve - CDF plot
I don’t understand what the problem is. Try this: mu = 1; sd = 2; x = linspace(mu-10*sd, 1.96); CDF = normcd...

9 years ago | 0

| accepted

Answered
How get the number in a row above
One approach: r = [1 2;-2 -3]; [r2min,idx] = min(r(2,:)); ElementAbove = r(1,idx)

9 years ago | 0

| accepted

Answered
PDF function does not give same result as normpdf
You need to calculate *|‘x’|* differently (so that it creates the same interval that *|linspace|* does), and square *|‘sigma’|* ...

9 years ago | 0

| accepted

Answered
How can i use interval with decimal at the end of a count in for loop. e.g. t=1:1:18.7
It depends on what you want to do. The second value in your <http://www.mathworks.com/help/matlab/ref/colon.html *|colon|*> (li...

9 years ago | 2

Answered
Seeking Help for Scatter Plots
This is easier to do with *|plot|* than with *|scatter|*: x = 1:5; y = [2 3 NaN; 5 2 4; 3 NaN NaN; 6 5 3; 1 3 4]; ...

9 years ago | 1

Answered
How to use two logical operation inside a if condition?
They are evaluated left-to right. See the documentation on <https://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcirc...

9 years ago | 0

| accepted

Answered
Hold on not working when plotting graph from a cell array
This works: figure(1) hold on for i=1:n x1=data{i,1}(:,1)+273.15; y1=data{i,1}(:,3); plot(x1,y1...

9 years ago | 3

| accepted

Answered
How to Detect Two maxima peaks
Use the *|'MinPeakHeight'|* and *|'MinPeakDistance'|* name-value pair arguments. *_Example_ —* [pks,locs] = findpeaks...

9 years ago | 1

| accepted

Answered
How to solve for a trigonometric equation
Rearrange the equation, then use *|fzero|*: Hperson = 175; Fdist = 120; F = @(x) 0.7978 + 0.7978*tand(x).^2 - (Hper...

9 years ago | 0

| accepted

Answered
wblfit won't run despite having toolbox
The first approach for such problems is to run these calls from the Command Window or a script: restoredefaultpath reh...

9 years ago | 0

Answered
How to plot variable values on x axis?
The easiest way: y=[0 1 2 3 4 3 2 1 0 0 -1 -2 -3 -4 -3 -2 -1 0]; x=[0.2 1 6 9 12 9 6 1 0.2 0.2 -1 -6 -9 -12 -9 -6 -1 0....

9 years ago | 1

Load more