Question: I used this code but i think is in not working right. >> clc; clear all; tspan = [-1 2]; y0 =- 3; %ode45 [x,y]
I used this code but i think is in not working right.
>> clc;
clear all;
tspan = [-1 2];
y0 =- 3;
%ode45
[x,y] = ode45(@(x,y) y^2-x^2, tspan, y0);
plot(x,y,'r')
hold on
y01=0;
[x,y1] = ode45(@(x,y) y^2-x^2, tspan, y01);
plot(x,y1,'b')
xlabel('x','fontsize',15)
ylabel('y','fontsize',15)
legend('y(-1)=-3','y(-1)=0')
title('my namei','fontsize',25)
text(0,0.01, datestr(clock), ...
'Units', 'normalized', ... % Not depending on the data
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom');
Consider the following differential equation: dy a. Use the MATLAB routine ode45 to generate approximate solutions to this differential equation over the interval-l
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
