Answered
Make unit vectors at equal angles without for loop
Possibly — a = linspace(0, 2*pi, 7); r = 1; x = r*cos(a); y = r*sin(a); zv = zeros(size(a)); figure plot([zv; x], [zv;...

4 years ago | 0

Answered
How to draw the figure dot like this. ( I have a example figure.)
Try this — A = [30 45 60; 0.069491 0.135992 0.398871; 0.069491 0.135992 0.398871]+[0; 0; 0.3]; figure plot(A(1,:), A(2:3...

4 years ago | 0

| accepted

Answered
How can I make a 3D bar chart for a 1044X22 array which is colored with height?
I am not certain how clearly that sort of matrix can be defined Try this — Data = rand(1044,22); figure b = bar3(Data); ...

4 years ago | 0

| accepted

Answered
vpasolve gives answers outside the range that I specify
One option is to specify conditions on the variables, for example on ‘E’ (and any others you may want) — syms E C D V P S A a...

4 years ago | 0

Answered
How do I multiply two functions handles?
In the ‘D_i’ function, ‘c_i’ was originally missing its argument, and that threw the error. Correcting that, and vectorising ...

4 years ago | 1

| accepted

Answered
Visualy change values of legend
Possibly — x = [1:288]; y = rand(288,1); plot(x,y); xlabel('time in 5 min') ylabel('random numbers') title('24/5 over a...

4 years ago | 0

Answered
How to extract y-value data at a certain x-value?
The code is incomplete and cannot run as posted. Using the .fig file instead: F = openfig('Velocity against frequency for c...

4 years ago | 1

| accepted

Answered
How to plot 2 symbols with an equation that contains complex numbers
Two symbols (variables) will plot a surface, so use fsurf to view it — syms Bs Gs M(Bs,Gs) = (73968.9477018175*Gs^2 - (-0.00...

4 years ago | 0

| accepted

Answered
How to determine the reverse saturation current
I believe at least two multiplication operators are missing, after the ‘Na’ and‘Nd’ references: N_a=1.0*10^22; N_d=1.0*10^2...

4 years ago | 0

Answered
MATLAB function 'nearest' does not work.
The nearest function is used with graph or digraph objects. Apparently, you are using it with something else. Without knowin...

4 years ago | 0

Answered
Revolving a curve around the z- axis
The easiest way to do that would likely be to use the cylinder function — x = -10:0.01:10; y = -10:0.01:10; r=sqrt(x.^2+y.^2...

4 years ago | 0

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

Load more