Answered
How to set the phase offset when using Margin Command
They appear to me to actually be the same. The difference is that margin appears to use the unwrap function, and bodeplot does ...

6 years ago | 0

| accepted

Answered
Solving for a value using a while loop.
You can get around the function problem by creating ‘rhs’ as an anonymous function: rhs = @(t,x,j,c,k) [x(2); (-k*x(1)-c*x(2))...

6 years ago | 1

| accepted

Answered
Fourier Series of Rectified Cosine Function
Try this: syms n t T = 8; Wo=2*pi/T; nv = (1:3); an = (2/T)*int(2.5*cos(n*Wo*t)*cos(n*Wo*t),t,-2,2) AN_numeric = double(...

6 years ago | 1

Answered
how to find fwhm using fwhm()?
The fwhm function is a File Exchange contribution. As I read the function code, it should likely give you something other than ...

6 years ago | 0

| accepted

Answered
Plot 2 functions red and blue with plot function
Try this: syms n f1(n)= n* tan(n); f2(n)= n+1; figure fplot(f1, [-pi pi], 'r') hold on fplot(f2, [-pi pi], 'b') hold...

6 years ago | 0

Answered
Multiplying Matrices, but with elements added together
Yes, there is! Try this: A = [2; 3; 4]; B = [1 3 5]; C = bsxfun(@times, A, B) % Before R2016b C...

6 years ago | 0

| accepted

Answered
penalty fitness value not changing
The penalty may not change. In the options structure (in R2020b), I would use: 'PlotFcn',@gaplotbestf instead of whatever you...

6 years ago | 0

Answered
Can someone help me with ODE45 function
I read it diferently: f = @(t,v) (489.369-0.001464*v^2)/(-1.44*t+10) - 9.81

6 years ago | 1

| accepted

Answered
Help With Graphing on the Same Plot
Plotting specific time vectors as well as ‘R’ or ‘B’ might do what you want. (We cannot run your code.) Example — plot(tR,...

6 years ago | 0

| accepted

Answered
feature ranking for regression using F-tests
You have not posted the Release you are using. (There is an option to do that just below ‘Products’ in the right margin of this...

6 years ago | 0

| accepted

Answered
Asian Call Put option simulation + Confidence intervals
Your error is in assuming that they have normal (or t) distributiond. They do not. They appear to be exponential or gamma ...

6 years ago | 0

| accepted

Answered
How to use fprintf statements after a function
Yes. Try something like this: x = ...; y=vorder(x); % Call Function fprintf('Input...

6 years ago | 0

Answered
How to find indices of nearest zero values to a peak in the data?
This should get you started: x = linspace(0, 25); % Create Data y = sinc(x-10); ...

6 years ago | 1

| accepted

Answered
Zero pad vectors within cell array to make them equal length
I do not know what the dimensions of ‘sigvecarray’ are, however I assume they are all column vectors. If so, replace the (,) ...

6 years ago | 1

| accepted

Answered
how to change the type of points for a plot
This should get you started: x = 1:10; % Create Data...

6 years ago | 0

| accepted

Answered
I plotted my recorded signal using fftshift and got two symmetric spectrums in Matlab. How can I display half of the frequency spectrum result? Thanks
I do not have your data, so I am using only the information that you provided. This is how I would do it: dt = T_ADE(2,1)-T...

6 years ago | 0

| accepted

Answered
exponential fitting to limited data
It needs to be changed slightly, adding an additional parameter: x = 35:5:70; y = [2.5648 1.2495 1.1663 1.0652 2....

6 years ago | 0

Answered
Which equation should I use to plot the surface of a 3D egg shape?
It depends on how the shape is defined. For this example, the surf or mesh function works, depending on what you want: [X,Y,...

6 years ago | 1

| accepted

Answered
Equation of the Line in command window
Try this: B = [y(:) ones(size(y(:)))] \ x(:); fprintf('Linear: y = %.4f*x%+.2f', B) ...

6 years ago | 0

| accepted

Answered
Loop "Replace String" from different string arrays
Try this: ColorIndexed = [compose("%.4f %.4f %.4f", rand(145,3)), compose("%3d",(1:145).')]; % Create String Array I1 = comp...

6 years ago | 0

Answered
Getting directly range of value from MATLAB table?
Try this: Freq = 1:10:1E+6; % Create Frequencies Amplitude = randn(size(Fre...

6 years ago | 0

| accepted

Answered
12 lead ECG and ambulatory(3 lead) ECG
I have not looked at the data, however I doubt that a 4-column matrix could be a 12-lead EKG. It most likely represents a vecto...

6 years ago | 0

| accepted

Answered
How to remove cells that have two or more occurrences in a file?
I created some duplicates to demonstrate this code: A = {'155809966' '6K0809966B' '6N0815478B41' '6N0815478B41'...

6 years ago | 1

| accepted

Answered
alternate way , without ismember function
The ismember function is doing exactly what you told it to do! What’s the problem?

6 years ago | 1

| accepted

Answered
Line of best fit
It depends on what you intend by ‘best fit’. For a linear fit, add these lines: P = polyfit(xaxis, stress, 1); linfit = po...

6 years ago | 1

| accepted

Answered
TDOA to Estimate Source Location
I’m not certain, however I believe what you actually want is something like this: E = [((x_2-x)^2 - (y_2-y)^2) - ((x_1-x)^2 - ...

6 years ago | 1

Answered
Change of units from centimeters to inches?
An Interweb search reveals Compute Conversion Ratio Between Units of Length in the Mapping Toolbox (that I do not have), so I ...

6 years ago | 0

Answered
Integration of a vector function
Perhaps: Result = integral(@(t) sin(t).*[1 0 0] + 6*[0 1 0] + 4*t*[0 0 1], 0, 4, 'ArrayValued',1) That runs without error, an...

6 years ago | 0

| accepted

Answered
Error "Attempt to execute SCRIPT ode113 as a function" in MTLAB R2014a
You have a script that you saved as ode113.m. You need to rename it to something like ode113_file.m or something that makes s...

6 years ago | 0

| accepted

Answered
How to make alternating signs on a matrix?
Another approach: E=[1:4;6:9;11:14;16:19]; m = (-1).^toeplitz((1:size(E,1)),(1:size(E,2))); % Multiplier Matrix Out =...

6 years ago | 0

| accepted

Load more