Hmm, weird. Just to be sure, this is the script I have :
clear all;
m = 200;
k = 100;
v0 =0;
u = 200;
t = linspace(0,15,1500);
v = exp((-k/m)*t)*(v0-(u/k))+u/k;
figure(4);clf(4);
plot (t,v);
grid on...
Yes, I tried that before I posted the question. The problem then is that the graph start at 1 and not 2. The initial value for v0 is set equal to 2 and not 1.
I am expecting the second graph to start where the first one finished. It should be continuous.
This is how I implement your solution...
Hi Guys!
I am trying to plot two different graphs in the same window using MATLAB. I have some constants that I declare, I then plot the graph from 0 to 15 seconds. Then I change two constants and plot another graph from 15 to 30. The units along the x-axis is Time (seconds) and velocity along...
Alright boys, thank you for the help on the Simulink part (NOT). I have now managed to set up the model in simulink. Now I am suppose to run the model from a MATLAB M-file (script). I initialize the variables and run the simulation from the script, plotting x1 and x2 against each other.
The...
Not sure if I am right, but I might give it a try. I am new to MATLAB.
what if you try something like :
v = start : spacing : end
where v is the vector containing the starting value, increment value (optional) and finally the end value.
example : v = 1:10 % this will create a vector...
Homework Statement
As the title says, I am trying to implement two differential equations into Simulink. I don't know how to start. How do I know what to start with, which block goes where? when do I add something and when do I know to subtract something using the sum block. When I got my...