PDA

View Full Version : MATLAB HELP


student12321
1 Apr 2009, 5:06am
hey im new to matlab and i have to make a mfile in matlab that uses only two (scalar) variables, x and y. any help would be much appreciated

function taylor2
fprintf(‘values of x approximation y\n’)
x= 1 ;
y = 2 ;
h = 0.01 ;
fprintf ( ‘%8.2f ’,x), fprintf (‘%19.8f \n’,y)
for i = ____________________
y = ______________________________ ;
x = __________________________ ;
fprintf ( ‘%8.2f ’,x), fprintf (‘%19.8f \n’,y)
end

Snarkasm
1 Apr 2009, 3:20pm
Well, you've done that. That's an mfile using only x and y right there.

Now what are you trying to do with them?

student12321
2 Apr 2009, 12:27am
i want it to compute an approximate solution to an initial-value problem on the interval [1, 1.2] using step size h=0.1... i need to fill in the blanks in the file