function mainoptions=odeset('RelTol',1e-06)Xo = [1;0];tspan = [0,5];[t,X] = ode45(@TestFunction,tspan,Xo,options);figurehold onplot (t,X(:,1));plot (t,X(:,2),':')legend ('x1','x2');ylabel('x');xlabel('t')return function dx_dt=TestFunction(t,x) %function which returns a rate of change vector
M=[i,i;i,i] dx_dt=M*x; return
full error message:
Warning: Imaginary parts of complex X and/or Y arguments ignored > In ode_plot_6 (line 17)
The program plots the graph, but generates the above error. Please help in eliminating the error message. Thank you.
Best Answer