Hi all,
Just a small problem with notation. I have the following for loop:
G = []; W = []; W(1) = 77000; for i = 1:29 G = [G, SFC*Thrust1(i)*(disp(i)/V1(i))] W = [W(i+1), (W(i)-G(i))] end
I am getting the following error:
Index exceeds matrix dimensions.Error in fueloptimal (line 139) W = [W(i+1), (W(i)-G(i))]
I need to define W(i+1) using the empty parenthesis before the 'for loop', i.e. W = [ ]. Have I done this correctly? Or is the issue coming from somewhere else?
Thanks in advance!
Best Answer