Answered
Extract data from a bode plot.
s = tf('s'); HLM = ((2.524e-06)*s^3 + 37.11*s^2 + 37.6*s)/((2.704e-07)*s^3 + 1.767*s^2 + 41.36*s + 80); Finf = 1e-3; %Hz Fs...

4 years ago | 1

Answered
substract an element from previous element in a matrix
The diff function seems to be appropriate.

4 years ago | 0

Answered
Plot level curves and projections as a contour
I am not certain what result you want. The contour3 function or surfc could be an option — N1 = 10; N2 = 10; x1 = linspac...

4 years ago | 0

| accepted

Answered
ODE45 needs column vector from anonymous function
Do element-wise division: yprime = @(x,y) ((-x.*y)./(sqrt(6-(y.^2)))); ↑ and it does — options = o...

4 years ago | 0

Answered
Error using mesh, Z must be a matrix, not a scalar or vector.
In figure(3) the code needs to be: [tt,xx]=meshgrid(t1,x); mesh(xx,tt,T) The problem was using ‘t’ instead of ‘t1’ and using...

4 years ago | 0

| accepted

Answered
sub2ind - understanding question
The graphic explanation in Examples explains how MATLAB stores and addresses matrices using both linear indexing and subscripts....

4 years ago | 0

Answered
How to plot this function with the interval of [-2,2]?
Use fimplicit — syms x f(x) = x + 1 - 2*sin(pi*x) figure fimplicit(f, [-2 2]) grid xlabel('x') .

4 years ago | 0

Answered
Find zero crossings in each row of a matrix (321 x 123 double)
t = linspace(0, 5, 123); % Create Data A = sin(randi(9,5,1)*2*pi*t/5 + 2*pi*randi(9,5,1)) ...

4 years ago | 0

| accepted

Answered
How to plot this equation?
syms t y f(t,y) = 2*y/t - (t*y)^2 figure fsurf(f, [-5 5 -5 5]) xlabel('t') ylabel('y') zlabel('f(t,y)') It is nec...

4 years ago | 0

Answered
Plotting phase space for 2nd order nonlinear ODE
I am not certain what you want to plot for the phase plot. This calculates and plots as a funciton of and also calculates t...

4 years ago | 1

| accepted

Answered
How to plot graph?
Try this — Ax = gca; Ax.YAxis.Exponent = 0; I checked, and this will work in R2018a according to the R2018a NumericRuler Pro...

4 years ago | 0

| accepted

Answered
How do i plot the phase of fft values in a matrix?
Use the angle function to calculate the phase from the complex fft result. The unwrap function may also be helpful, depending o...

4 years ago | 1

Answered
How to optimize an objective function with repect to two variables using fmincon?
The general approach to maximising a function is to negate it so the minimum that the optimisation functions find is actually th...

4 years ago | 1

| accepted

Answered
Find boundary of curve-forming points
This is not perfect, however it is the best I can do with these data — LD = load('data.mat'); beta = LD.beta; r = abs(beta...

4 years ago | 0

Answered
Converting discrete signal to frequency domain
The fft calculation an plotting is straightforward. (You can also use the pspectrum function and others.) Fs = 100; Fn = Fs...

4 years ago | 0

| accepted

Answered
Matlab 2015a Script to solve the equation w=-tan(0.8*w)
Use vpasolve with an initial value (or range of values as described in Specify Ranges of Solutions) — syms w EQ = w + tan (0....

4 years ago | 0

| accepted

Answered
Please explain this code about differential equations.
They refer to the function values returned by ode45 (in this code). y(1) is y(2) is y(3) is That can easily be inferre...

4 years ago | 0

Answered
divide a string every 15 characters
Try this — A = ["+6.64430238e+00+1.14987825e-02-4.68099585e-06+9.62334222e-10-8.24360065e-14"]; B = string(reshape(char(A),15...

4 years ago | 1

| accepted

Answered
Trigonometric non linear equation
Try something like this — theta=30; k=360; h=0.5555; F = @(h) ((cosd(theta).*(sind(k*h).^2)) - (2*(sind(k.*h.*cosd(theta))....

4 years ago | 0

| accepted

Answered
How do I hyphen a word using LaTex?
It appears to work as written — figure xlabel("multi-disciplinary", 'Interpreter','latex') Do you want a different result? ...

4 years ago | 0

Answered
Arrays have incompatible sizes for firpm() function.
The ‘frequency’ and ‘response’ vectors must be the same lengths, and they must have even numbers of elements (according to the d...

4 years ago | 0

| accepted

Answered
Fitting a curve (not a surface) for set of 3d points
I have no idea what model you want to fit to the data. This does a linear regression — A = [-27.9887180593615 -1340.7554656...

4 years ago | 0

| accepted

Answered
Using plot with dates stored in a cell array
I get a different result — i = 1; dates{i} = '1/22/20'; dtv = datetime(dates{i}, 'InputFormat','MM/dd/yy') That appears to ...

4 years ago | 0

| accepted

Answered
How do I save multiple PCA results in a cell array? Error: Brace indexing not supported
I am not certain what the problem is. This runs without error for me, and produces the appropriate result — LD = load('pre...

4 years ago | 0

| accepted

Answered
Needing help using ode15s to solve an equation.
I find it easiest to let the Symbolic Math Toolbox do all the heavy lifting — syms C(t) C_in C_0 Q_in Q_out t V_0 Y DE = (V_...

4 years ago | 1

| accepted

Answered
help plot of function using handle
Call ‘G’ with its argument — b1 =1 b2 =2 b3 =3 b4 = 4 % Replace Missing Value %------...

4 years ago | 1

| accepted

Answered
Numerical Fourier transforms of matrix?
I have no idea what you want. I would not suggest integrating the individual sine and cosone coefficients using numerical integ...

4 years ago | 0

| accepted

Answered
Can I use an anonymous function as an input to a regular function
I am not certain what you are doing. Try this — anon = @(x) x+3; y = hello(3,anon) function y = hello(input1,fcn) ...

4 years ago | 0

Answered
How do I keep f as a variable in a state space model, as f is supposed to be the input variable??
Since ‘f’ is only defined in ‘B_motor’ simply create an anonymous function from it, and then from ‘motor_ss’ (to keep with the e...

4 years ago | 0

| accepted

Answered
Using splitapply to add a column to a table
I am not certain what result you want. Try this — Tickers = ["AAPL"; "AAPL"; "AAPL"; "MSFT"; "MSFT"; "MSFT"]; MonthlyRetur...

4 years ago | 0

| accepted

Load more