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

1 view (last 30 days)
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 !!

Accepted Answer

the cyclist
the cyclist on 19 Oct 2014
Edited: the cyclist on 19 Oct 2014
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)

More Answers (0)

Categories

Find more on Matrices and Arrays 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!