Answered
How to merge multiple plots into one?
‘I wan to plot all these curves17times on a single figure.’ Put the figure call before the loops: figure hold on for j = ...

6 years ago | 1

| accepted

Answered
Plot 2 curves in a 3D space at a different angle
Experiment with this: t = linspace(0, 1); x = cos(pi*t); y = sin(pi*t); a = [sind(0); sind(47)]; ...

6 years ago | 1

| accepted

Answered
How to find the Zero Crossing Rate of a signal?
Try this: t = linspace(0, 5, 500).^3; % Time Vector s = sin(2*pi*t*0.2); ...

6 years ago | 1

| accepted

Answered
X label cuts off in logscale
I do not understand what you want for the x-tick labels. First, run your code with this to see what it does, and then adapt t...

6 years ago | 0

| accepted

Answered
How to reference a previous step in a for-loop? ALSO how to trigger a loop to stop?
‘How do I properly referenc a previous step in the loop?’ One way is to define the values of ‘D’ and ‘E’ before the loop, the...

6 years ago | 0

| accepted

Answered
system of differential equations, function call
Try this: function zombie1 = zombie(t, x, a,b,bd,d,i,n,r) zombie1 = [b*x(1) - d*x(1) - i*x(1)*x(3) - bd*x(1)^2; ...

6 years ago | 0

Answered
Plotting 3d ODE
First, delete the meshgrid call, since it is not necessary here. The ode23 call produces vectors, not a surface. Second, plo...

6 years ago | 0

Answered
Why won't my linear regression line show?
I believe there is something wrong with ‘computeprice’. It should produce a vector the same length as ‘t’ that is then compared...

6 years ago | 0

| accepted

Answered
fsolve problem :Not enough input arguments.
It is necessary to supply values for all the arguments. Try this: x = fsolve(@(x)steady_fsolve_nbar_CFE(x,alpha,phi,sx,abbr...

6 years ago | 0

| accepted

Answered
can someone help me with derivatives
You will need to create ‘f’ as a symbolic function (possible in R2012a and later versions). Either of these will work: syms...

6 years ago | 0

| accepted

Answered
Why is fft of one part and the entire signal the same?
You asked me to respond to this (as a Comment to another of my Answers), so I will. The two Fourier transforms of the various...

6 years ago | 0

| accepted

Answered
MATLAB r2018a data import problem.
For .mat files, use the load function, and load the contents into a structure, as discussed in the load documentation. For text...

6 years ago | 0

Answered
How can i get frequency domain of an earthquake?
Try this: acc = readmatrix('EQ.txt'); L = numel(acc); Ts = 0.01; Fs = 1/Ts; Fn = Fs/2; t = linspace(0, L, L)*Ts; FTacc...

6 years ago | 0

| accepted

Answered
create dummy variable for different time periods
Try this: Dependent = @(t) exp(1.2 + 0.0099*t).*((t>=20) & (t <= 24)) - 0.0625*exp(-0.0134*t ).*((t>=25) & (t<=100)); t =...

6 years ago | 0

| accepted

Answered
Legend Problem in Scatter Plotting
See if this does what you want: [m,n] = size(y); x1 = X(:,1); x2 = X(:,2); for j=1:1:n for i=1:1:m if y(i,j)=...

6 years ago | 1

| accepted

Answered
What is the formula used by nlparci?
If you want to see the actual code: edit('nlparci.m') may allow you to see it. (I did not try that. Regardless, do not chan...

6 years ago | 0

Answered
Legend Problems with Graph
Try something like this: figure(6) %corresponds to bottom graph % clf hold on h1 = plot(pos01,Umeasured1,'k-o','MarkerSize'...

6 years ago | 1

| accepted

Answered
How to calculate the hourly average
If you have R2016b or later, this is straightforward: T1 = readtable('Matlab.csv'); First_5_Rows = T1(1:5,:); TT1 = table2ti...

6 years ago | 0

| accepted

Answered
Kinetics model-Why i dont get 3 graphs of these modeling, but i get just one for C catalyst. Is there problem with definition of k?
If you want to fit your differential equations to the ‘k’ matrix to estimate the parameters of your system, your current approac...

6 years ago | 0

| accepted

Answered
Uneven linspacing of an array
I am not certain of the result you want. One option would be to use logspace instead of linspace, since that would produce lo...

6 years ago | 0

Answered
How can I save and plot all values of x and y for each value of V? x and y values are in the vertical axis and V in the horizontal axis in the graphic
Try this instead: V=[1,2,3,4]; for k = 1:numel(V) xy(:,k) = [V(k) 1; -1 1] \ [2; 3]; end figure plot3(xy(1,:), x...

6 years ago | 0

| accepted

Answered
Isolate reflection from a signal
The reflections are likely going to be opposite in sign from the indicent signal. One option is to use the findsignal function ...

6 years ago | 0

Answered
Help on plot 3 roots for each variable and connecting them
See if this slightly edited version of your code does what you want: n = 10; K_p_neg_inf = -1000; K_p_pos_inf = 1000; K_p_n...

6 years ago | 0

| accepted

Answered
help with row vector
See the documentation on linspace.

6 years ago | 1

| accepted

Answered
smoothed scatter plot matlab like excel
I have no idea what you want. Try this: X = [6;10;13;23]; Y = [3.78E-04;1.06E-03;1.78E-03;2.10E-03]; Xi = linspace(min(X)...

6 years ago | 0

| accepted

Answered
whats wrong with my code??
Yoiu need to do element-wise operationsn (using the dot operator): v=((m.*g)-(m.*a))./k See Array vs. Matrix Operations for d...

6 years ago | 0

Answered
how to display on increment 0.5 for time
Change this: for t=0:0.001:10 to: for t=0:0.5:10 That is the only line that defines ‘t’ that I can see, so that one change...

6 years ago | 0

| accepted

Answered
solving system of equations
This runs without error (after several changes): V = 2435 ; k = 1.076 ; Kn = 0.27 ; k=1.076; Y=0.39; kd=0.04; bs=0.15;...

6 years ago | 0

Answered
How to solve Ordinary Differential Equations with Sin(wt) ?
I replaced ‘i’ with ‘c’ to avoid problems with imaginary operators: syms c(t) w t i0 Eqn = 10*sin(w*t) == 0.001*diff(c) + 100...

6 years ago | 0

Answered
how to solve 5 equations with 5 unknowns.
Use the Symbolic Math Toolbox: syms T x r k K_c Eq1 = T==300+200*x Eq2 = -r==0.1*k*(1-x-(x/K_c)) Eq3 = 2500==x/(-r) Eq4 =...

6 years ago | 1

| accepted

Load more