Answered
How to make this contour plot like this ??
Increase the numnber of contours. See Contours at Ten Levels for an illustration.

5 years ago | 0

Answered
error using integral function
‘but in directly i is depending on t because v is depending on t and y is depending on v’ True, however integral has no way o...

5 years ago | 0

Answered
How to graph equations with different x domains?
First, code it correctly, then use logical indexing — t = linspace(0, 110); x1 = @(t) -10000*exp(-0.05*t) + 10000; x2 = @(t)...

5 years ago | 0

| accepted

Answered
How do I pass the signal through a low-pass FIR filter?
if ‘h’ are the numerator vector of the filter (and the filter is designed correctly) — signal_filtered = filtfilt(h, 1, signal...

5 years ago | 1

Answered
problem with ode45 solving
Assuming both functions are functions of time — syms x(t) v(t) u = sym(1); ode1 = diff(x) == v ode2 = diff(v) == u [x(t)...

5 years ago | 1

| accepted

Answered
Lsqcurvefit and ode45 to fit data to system of differential equations
Note that neither ‘x’ or ‘t’ are explicity arguments to ‘Testv3Solver’, so nothing is passed to it and nothing ever changes — ...

5 years ago | 0

| accepted

Answered
Solving coupled second order differential equations using ODE
None of the variables you are passing to ‘ftotal’ have been defined numerically (at least in the posted code). They need to b...

5 years ago | 0

| accepted

Answered
How do I calculate power for each signal?
Use the buffer function to segment the signal into 1-second increments. Since you want 1-second samples, the vector length is s...

5 years ago | 1

| accepted

Answered
How to find what values of a and b give the minimum value in the sum
This is a relatively straightforward optmisation problem. Try this — x = randn(20,1); ...

5 years ago | 0

Answered
fopen error using text file
Use the fullfile function to build the complete path.

5 years ago | 0

Answered
How can I get the transfer function?
Using the Symbolic Math Toolbox is likely not appropriate here. Try this instead — s = tf('s'); G = (-3.2*s^2 - 2.9*s -0.0...

5 years ago | 0

Answered
Array indices must be positive integers or logical values.
There were problems with indexing ‘freqArray’ and then ‘toneArray’. See if this does what you want — ...

5 years ago | 0

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

Load more