Hello
I´m working on a numerical solution for an equation. Therefore I wrote the following function:
function test(dBL,i)
for n=1:i BL=0;
while (1+cos(BL)*cosh(BL))*(1+cos(BL+dBL)*cosh(BL+dBL))>0
BL=BL+dBL;fc=1+cos(BL)*cosh(BL);end
vfc(n,1)=fc;
vBL(n,1)=BL;
end
vfc
vBL
end
My aim is that the matlab function produce as many solutions as n and the important output is vBL, which is a vector with the solutions.
I want the while loop to start with BL=0 for n=1, but for n=2 I want the loop to start with the last BL from the previous while loop and so on. Anybody can help??
Thanks in advance
Best Answer