Answered
How to add time duration of peaks in plot
I am not certain what you want. Try this — x = linspace(0, 20, 250); ctrv = rand(3,1)*18; y = sum(exp(-(x-ctrv).^2./rand(...

4 years ago | 1

Answered
Labels inside bar plot
Try this — v = 52 .^ 1./(4:-1:1); barname = {'Small','Medium','Large','Extra Large'}; figure hbh = barh(1:4,v, 'FaceAlpha...

4 years ago | 0

| accepted

Answered
filtering by filter function and having a shift
See if using the filtfilt function instead of filter solves the problem.

4 years ago | 1

| accepted

Answered
FT and Amplitude Phase plot in matlab
Try this — syms t w x2 = ((t-5)^2)/exp(8*t) x2_FT = int(x2*exp(-1j*w*t), t, -1, 1) figure fplot(real(x2_FT), [-100 100]...

4 years ago | 0

| accepted

Answered
I need to reverse contour LevelList
Yes. Use the colorbar function. If you want to remove the contour labels, use 'ShowText','off' as described in Contours with...

4 years ago | 1

| accepted

Answered
How to add a horizontal line in a plot that corresponds to a maximum?
Another option is the envelope function — movRMS = dsp.MovingRMS; % The Signal Codes (assume no noise) t = (0:0.0001:1);...

4 years ago | 1

Answered
How to move the axes so that they start from the center of the sphere (0,0,0)
Try something like this — R = 1 ; theta = linspace(0,2*pi) ; phi = linspace(0,pi) ; [T,P] = meshgrid(theta,phi) ; X1 = R*c...

4 years ago | 1

Answered
Unrecognized variable Using solve command
Perhaps: syms theta just after the ‘outputs’ comment would help. Also MATLAB is case-sensitive, so change: Angle = 10;...

4 years ago | 0

Answered
How can I find the distances between peaks in an experimental graph?
Without even an image of the plot it is difficult to understand what you want to do. Try this — x = linspace(0, 10); ctrv ...

4 years ago | 0

Answered
Why the command does not displaying my answer?
Remove the semicolon (;) from the end of each line to print out the results of that line to the Command Window. The semicolon...

4 years ago | 1

| accepted

Answered
Automatic generation of Legend
In the legend documentation, see the section on Specify Legend Labels During Plotting Commands. Specifically here: plot(x, ...

4 years ago | 0

| accepted

Answered
i Need help please
See the documentation for odeToVectorField and matlabFunction .

4 years ago | 0

| accepted

Answered
How can I bulid the exponential envelope of a damped second-order system oscillator?
One option is presented in Damped harmonic motion curve fit where the exponential envelope function is one of the parameters the...

4 years ago | 1

| accepted

Answered
Select certain peaks of a graph on only values of over 50
Use the 'MinPeakHeight' name-value pair: [pks,locs]=findpeaks(B{1,1}, 'MinPeakHeight',50); .

4 years ago | 1

| accepted

Answered
Renaming the variabel while Symbolic to function handle conversion with matlabFunction
To get the ‘A’ values as a vector, put them in square brackets []. func = matlabFunction(F1d, 'Vars',{[A1,A5],xdata,ydata}) ...

4 years ago | 0

| accepted

Answered
Can't get the four values I need
They are roots of 16th degree polynomials — syms a b l w equ1=648.4-b-a-2*l*w; equ2=3893.78-a*b-2*b*l*w-w^2; equ3=1835.22-2...

4 years ago | 1

| accepted

Answered
Converting linear scaled magnitude and phase to complex Values
If it is not in dB, then the conversion is straightforward — cplxv = S11MAG .* exp(1i*deg2rad(phase)); That should produce th...

4 years ago | 2

| accepted

Answered
legend - missing description colors and signs
The legend also does not have the box around it, and I see not specific calls to suppress it. This was a problem several mont...

4 years ago | 0

| accepted

Answered
I would like to write a for loop to calculate fwhm value based on a range of Strain values. Say Strain = 50:10:150 and find the corresponding fwhm values in a vector
Calculating the width for every value of ‘Strain’ is reasonably straightforward — X = (0:0.01:0.3); Y = -9200*(X).^2 + 2760*X...

4 years ago | 0

Answered
I am not getting a linear plot, how can I get a plot that consist all the data points?
You are asking it to read 30 rows across 4 columns, and it is doing exactly that — T1 = readtable('https://www.mathworks.com/m...

4 years ago | 0

| accepted

Answered
How to count the number of peaks from a graph with a certain threshold?
The findpeaks function only works on vectors, so assuming that the first column of the Excel file is the independent variable an...

4 years ago | 0

| accepted

Answered
How to make an axis that goes up and down?
The tick values must be monotonically increasing or decreasing. The tick labels can be whatever you want. x = 0:15; y = -0....

4 years ago | 0

| accepted

Answered
How to add legends?
Try this — r1=[19.38 65.3 15.32;16.66 62.13 21.21;18.21 58.31 23.49;19.11 59.95 20.94;16.53 67.27 16.19;19.41 63.87 16.72]; ...

4 years ago | 1

| accepted

Answered
Common part of 2D and 3D plot
I am not certain what result you want. It is straightforward to rotate the 3D plot to give a 2D view from the Z-axis — Uz =...

4 years ago | 1

| accepted

Answered
plot a surface for g-f=0
That is challenging, however it will work with certain restrictions on the matrix dimensions (i.e. they must both be the same si...

4 years ago | 0

| accepted

Answered
How can i generate a noise signal of specific frequency range like a noise signal from 100hz to 150hz .
Generate a random signal (perhaps using randn) of an appropriate size, and then filter it (perhaps using bandpass).

4 years ago | 0

Answered
Trouble trying to plot the output of an input signal with an impulse response
Use the fplot function — syms t s; x = (5/7)*exp(-t) - (12/7)*exp(-8*t); % x = x(t) h = cos(2*t) + 4*sin(2*t); % h = h(t) ...

4 years ago | 0

Answered
How to fixed the axis order in hist3 plot?
The problem may be using imagesc. Try set(gca, 'YDir','normal') x = randn(100,1); y = randn(100,1); data = [x y]; figu...

4 years ago | 0

| accepted

Answered
Convert numerical label Vector to char label
Try this — map = {'as','be','ce'}; % Cell Array a=[1 1 2 1 3 1 3 2]; b = map(a) b = strtrim(sprintf...

4 years ago | 0

| accepted

Answered
Errorbars on a select dataset
Try this — data2 = sortrows(randn(10,5),2); % Correct For Missing Data Experimental = sortrows(randn(10,5)...

4 years ago | 0

Load more