However, when we quit Matlab, all the information is gone. You have re-type them again if you want to it again! If you have a typo, you also have to retype them again.
Matlab will search the file and executes the Matlab command
in the file line by line. It is the exactly th esame as you would type
them in. After you quit Matlab, the file is still there, you can redo it
or modify it whenever you want. This kind of files are called Matlab
script files, which contains Matlab commands.
function y = feul(t,y)which takes inputs t and y and return a function value. In matlab, the usage is
>> feul(1,2)
ans =
2.6216
In Lesson 2, the function is called when we need the function value
at f(t(k),y(k))
y(k+1)=y(k)+h*feul(t(k),y(k));
global
c
% Added line.
c = 2/155;
...............
In ftay.m, add a line
function
ftay = ftay(t,x)
global c
% Added line
ftay = c*(102 - x);
In ftayu.m, add a line:
function
ftayu = ftayu(t,x)
global c
% Added line
ftayu = -c;