# help me in this problem please

#### يفضل

##### عضو جديد
Alsalam alajkom,
i have a problem with matlab, actually i want to sole two ordinary differential equations of first order and i wrote the program in matlab but it didnt worked,

this is the program which i have written

function xprime = f(x,t)

xprime = zeros(2,1);

xprime(1) = 1.7576*x(1) + 18.8*x(2);
xprime(2) = -62*x(1) + 4.632*x(2);
xprime=[xprime(1);xprime(2)];
[t,x] = ode45(*f,[0,10],[0;0]);

plot(t,x
);

the Matlab said that x is undefined, but in the help of matlam there is similar example and they solve it exatyly as i wrote here

### مواضيع مماثلة

#### م.أحمد عفيفي سلامة

##### عضو معروف
الحل بسيط

السلام عليكم ورحمة الله وبركاته
أخي الكريم الحل بسيط جداً
قم بكتاب أمر تعريف المتغيرات Syms بحيث يكون البرنامج كالتالي

function xprime = f(x,t)
xprime = zeros(2,1);
Syms x
xprime(1) = 1.7576*x(1) + 18.8*x(2);
xprime(2) = -62*x(1) + 4.632*x(2);
xprime=[xprime(1);xprime(2)];
[t,x] = ode45(*f,[0,10],[0;0]);
plot(t,x(;

هذا وتقبل خالص تحياتي
والله الوفق #### يفضل

##### عضو جديد
another one

Thank you that problem is solved but now when i running the progra i had this problem:

Index exceeds matrix dimensions

what shall i do?

Thank you