ERROR: Array indices must be positive integers or logical values
Show older comments
An error occurred while running the simulation and the simulation was terminated
Caused by:
- Error due to multiple causes.
- Array indices must be positive integers or logical values.
- Error in airshipsystemsimulation/Interpreted MATLAB Function5 while evaluating expression
%MATLAB FUNCTION CODE (USED WITHIN INTERPRETED MATLAB FUNCTION BLOCK WITH 9 INPUTS):
function op=airshipsyspgmoutqdot(u)
%inputs
ue=u(1);ve=u(2);we=u(3);
pe=u(4);qe=u(5);re=u(6);
phie=u(7);thetae=u(8);psie=u(9);
%%
%parameters
m=9.07;
B=72.2;
W=89;V=7.6;L=6;D=1.4;
a_z=-0.041;
Xx=1.12; Yy=7.25; Zz=7.25;
Kpdot=0;Mqdot=8.87;Nrdot=8.87;
Ix=2.19;Iy=18.85;Iz=18.76;
Ixz=0;
Xu=-10;Yv=-10;Zw=-10;Lp=-10;Mq=-10;Nr=-10;
Jx=Ix-Kpdot;Jy=Iy-Mqdot;Jz=Iz-Nrdot;Jxz=0;
mx=m-Xx;my=m-Yy;mz=m-Zz;
Tr=0.1;Tl=0.1;
%%
c1=cos(phie);c2=cos(thetae);c3=cos(psie);
s1=sin(phie);s2=sin(thetae);s3=sin(psie);
t2=tan(thetae);
qdot=0.0047*(-mz*we*qe+my*we*ve-m*a_z*pe*re-(W-B)*s2)+...
0.1004*((Jx-Jz)*pe*re+Jxz*((re).^2-(pe).^2)+m*a_z*(qe*we-re*ve)-W*a_z*s2-10+(Tr+Tl)*a_z);
op=qdot;
end
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!