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