Sunday, September 30, 2018

plot - Plotting time graph in MATLAB

I have a function of this form in MATLAB,




C=S*e^(L*t)*inv(S)*C_0


where my



     S=[-2 -3;3 -2] 
L=[0.5 0; 0 1.5]
C_0=[1; 1]



I need to plot this function with respect to time. My output C is a 2-by-1 matrix.



What I have done is computed e^L separately using b=expm(L) and then I inserted mpower(b,t) into the function. So my resulting function in the script looks like



  b=expm(L);
C=S*mpower(b,t)*inv(S)*C_0;


Now, how should I go about plotting this w.r.t time. I tried defining the time vector and then using it, but quite obviously I get the error message which says matrix dimensions do not agree. Can someone give me a suggestion?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...