Answered
how to get the plot from function
Uncomment this hold call — figure(1) plot(x1,u) % hold on N2=21 u=poisson(N2) and the code does what you want. N...

5 years ago | 0

| accepted

Answered
Plots using contourf in matlab
Try something lilke this — X = P(:,1); Y = P(:,2); Z = P(:,3); Xv = linspace(min(X),max(X),numel(X)) Yv = linspace(min(Y...

5 years ago | 0

| accepted

Answered
Butterworth filter for ecg signal in healthy people
The filter may be unstable, and if so, may not produce any output. Another possibility is that one or more of the elements of t...

5 years ago | 0

| accepted

Answered
Remove evenly distributed spikes from curve
See if the filloutliers function will do what you want.

5 years ago | 0

| accepted

Answered
how to remove outlier in signal?
If you have R2017a or later, use the filloutliers function.

5 years ago | 1

Answered
interp1 not working as expected and returning the same negative index for multiple query points (sample code and sample data included)
Another approach — DL = load('mathworks help workspace_interp1_20210426.mat'); data = DL.data; L = numel(data); samples =...

5 years ago | 1

| accepted

Answered
Filling in the area between the two plots
Try this — deg=pi/180; r1 = 6; r2 = 1/6; Rc=0; Xc=0; theta=-98*deg:pi/100:98*deg; R1=r1*cos(theta)+Rc; X1=r1*sin(thet...

5 years ago | 0

Answered
Plotting the volume of a set of 3D data
In the absence of the data (that I was hoping might magickally appear by now), I suggest using either boundary or alphashape. ...

5 years ago | 0

Answered
Help solving system of differential eqns: Invalid indexing error.
‘I believe it has something to do with the multiplcation of y and x^2.’ Correct. That makes it a nonlinear differential equa...

5 years ago | 1

| accepted

Answered
How to get matlab not to display matrix elements as 1*e^1 and display the elements in regular form instead?
That is likely the result of setting format short. Try this: format short G instead.

5 years ago | 0

| accepted

Answered
Fournier Command and Integral Command
I hope this is not homework! syms w t T f = t/(9 + t^2) F = int(f*exp(-1j*w*t), t, -T, T) F = int(f*exp(-1j*w*t), t, ...

5 years ago | 0

Answered
make netcdf vectors same length for plot
‘But i'm trying to plot SST over time at the lat and lon specified.’ I assume those are the ‘x’ and ‘y’ values. If so, choos...

5 years ago | 1

Answered
Finding the first time a number appears in a matrix
Try this — c = randi([650 750], 50)*1E-3; % Create Matrix [val,idx] = min(abs(c(:)-0.7)) ...

5 years ago | 1

Answered
Finding the first value in a matrix
I am not certain what you want. Try this — c = randi([650 750], 25); [cr,cc] = find(c==700) [RowMin,Idx] = min(cr) First...

5 years ago | 0

Answered
Help me draw the same graph
This will get you started — figure h = ezplot ('(2*x.^3 + exp (-x.^2))', [-2 2]); h.Color = 'm'; hold on xsquares = h.XD...

5 years ago | 0

| accepted

Answered
Double integration of a matrix
I sould use trapz once in each dimension of the matrix, so something like — A = rand(12); % Crea...

5 years ago | 0

| accepted

Answered
Hi everyone, can you help it gives an error of "Index exceeds the number of array elements (0)."
The error is thrown because initially ‘Radius’ is empty — Radius=[] whos Radius .

5 years ago | 1

Answered
Create an equation using curve fitting
The easiest way to do that is to combine all the relevant independent variables into one matrix, then refer to the columns of th...

5 years ago | 0

Answered
Only the ylabel does not change to latex interpreter
The LaTeX interpreter doesn’t like the ‘µ’. Try this: ylabel('$Average droplet velocity [\mu/ms]$', 'Interpreter','latex');...

5 years ago | 0

| accepted

Answered
How to add labels to the LEFT of a table
I’m not certain what you want. Experiment with this — Time = (datetime('2015-11-15 00:00:24')+hours(0:1.1:5.5)).'; Humidit...

5 years ago | 1

| accepted

Answered
Filter Sensor signal data to a vector of certain length
I would use interp1 to interpolate the higher-frequency sensor record to the times of the lower-frequency sensor record. If t...

5 years ago | 0

| accepted

Answered
How do I plot disorganized data?
I would first try the sortrows function. If I understand correctly what you want to do, that should work.

5 years ago | 0

Answered
How do I plot an intersection of a surface 3D and a plane?
Use the contourf function to get the intersection of the plane and the surface, and plot the result — H=0.5; nmax=6; l...

5 years ago | 1

| accepted

Answered
Plotting graphs for scaling analysis
The most common problem I see here on Answers is forgetting to use element-wise division, so (./) instead of (/). Making thos...

5 years ago | 0

Answered
Finding a variable in a very complicated equation
It would be nice if the constants were supplied. Using random numbers for them — x = rand; y = rand; P = rand; EI = rand;...

5 years ago | 1

| accepted

Answered
stem command working on the oppisite side of the axis
It is necessary to give stem a different base value in order for it to plot upwards to a negative value. Try this — s = tf(...

5 years ago | 0

Answered
How to make plot3 as surf?
One option might be to use repmat — z_sec2 = repmat(z_sec, 97, 1); then — figure surf(x_sec,y_sec,z_sec2) I have no idea ...

5 years ago | 0

| accepted

Answered
plot a 3d function (with three independent variable)
The isosurface function would likely be most apprroppriate. See the documentation section on Volume Visualization for more opt...

5 years ago | 0

| accepted

Answered
How to calculate the standard error of my linear regression coefficient?
You can certainly look this up and calculate it on your own, however using fitlm and predict is easier — x=[-7 -6 -5 -4 -3 -2 ...

5 years ago | 1

Answered
logging time and data and store it in a matrix
It is possible to use detectImportOptions and set the variables, however I find the following approach easier: T1 = readtable(...

5 years ago | 0

Load more