I have the following code which plots the solution below:
clear allclcn = [1 2 3 4 5]; % n = ts/tau
f = @(t_star,y,n) 1-y-(t_star/n); % y = theta* , t_star = t*
for i = 1:length(n) [t_star,y] = ode45(f,[0 n(i)],0,0,n(i)); %solves ode with n values
figure(1) line(t_star,y,'color',rand(1,3),'Linewidth',2),grid on ylabel('\theta*') xlabel('t*') ylim([0 1])endlegend('n=1','n=2','n=3','n=4','n=5')theta = [0 0.2642 0.297 0.267 0.2271 0.1919];N = [0 1 2 3 4 5];figure (2)plot(N,theta,'Linewidth',2)
I've displayed the data points using the data cursor tool in the figures toolbar. Is there a way to connect these points (make another line) within the same graph?
Best Answer