Right, so I have a function (similar to the false position method) with one big while loop and every iteration generates values
a and
b, which change with every iteration... What I'd like to do is create a vector
a=[a0,a1,a2...] where a0,a1 etc are the values of
a generated with each iteration and same for
bso it looks something like this...
function [
a,
b]=PlzDieMatlab(f,aini,bini,maxit,tolerance)
*initial conditions*
a=aini
b=bini
etc
whileblablabla
blablabla (either a new value for
a or a new value for
b)
end% now the important bit...a=
?b=
?endanyone have any idea how i can create a vector stating all the different that have been generated for values of
a and
b with the iterations?
an example of a correct function tested with values would be ...
a = [2 , 2 , 4 , 4 , 7]
b = [9 , 8, 8 , 7 , 7]
quote from the question .. "This means that the return values
a and
b are vectors with at most maxit elements,
a(1) sbould be aini, and b(1) should be bini. If the iteration stops after
i<maxit iterations are reached then
a and
b should contain i elements."
any help appreciated, thanks