Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to run Matlab code?' topicStudent Support Forum > General > Archives > "How to run Matlab code?"

Help | Reply To Topic
Author Comment/Response
Yitzhak Bar Geva
03/30/11 09:51am

Someone graciously assisted me in setting up a solution for two differential equations in Matlab.
Now I want to run it in Mathematica, but have not been able to determine how to convert.
Here's the Matlab code:

s = dsolve('Ds = -0.2','s(0)=40')
n = dsolve('Dn = -0.195','n(0)=-20')
s1 = ezplot(s,[0 200]); hold on;
n1 = ezplot(n,[0 200]); set(n1,'Color',[0 0.5 0])
d1 = ezplot(s-n,[0 200]); set(d1,'Color',[0.5 0 0])
% You need to manually fix the limits to auto-scale in the figure

figure;
ezplot(s,[0 2000]); hold on;
n2 = ezplot(n,[0 2000]); set(n2,'Color',[0 0.5 0]);
d2 = ezplot(s-n,[0 2000]); set(d2,'Color',[0.5 0 0]);
% You need to manually fix the limits to auto-scale in the figure

I'd like to know in general how to import and rum Matlab code in Mathematica.
Thanks,
Yitzhak

URL: ,
Help | Reply To Topic