Attempted to access Cpins(0.03); index must be a positive integer or logical

조회 수: 1 (최근 30일)
I am doing a matrix based f equations and I cannot all run the program because This error is showing all the time:
Attempted to access Cpins(0.03); index must be a positive integer or logical.
This is the part of matrix that the error is indicating:
AMAT=[-hout-hskyN-Kb/Lbriw ,-(Pbrick*Cpbrick*(Lbriw/2)*(1/deltat)) ,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;%A1
Kb/Lbriw ,Kins/Linsw ,-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pbrick*Cpbrick*(Lbriw/2)*(1/deltat)) ,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;%A2
0 Kins/Linsw ,Kgyp/Lgypw-(Pins*Cpins(Linsw/2)*(1/deltat))-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat)) ,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;%A3
0 0 Kgyps/Lgypw ,hin-(Pgyps*Cpgyps(Lgypw/2)*(1/deltat)) ,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;%A4
Cpins=1.30 (is not a negative number or an array or vector, just a value)
I been trying to change he value but nothing works.
Any help?? Thanks so much !!

채택된 답변

the cyclist
the cyclist 2014년 10월 19일
편집: the cyclist 2014년 10월 19일
In the row labeled "A3", you have
Cpins(Linsw/2)
where I expect you intended
Cpins*(Linsw/2)
and it looks like you make the same type of error in the next line, where
Cpgyps(Lgypw/2)
is presumably intended to be
Cpgyps*(Lgypw/2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by