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

1 Ansicht (letzte 30 Tage)
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 !!

Akzeptierte Antwort

the cyclist
the cyclist am 19 Okt. 2014
Bearbeitet: the cyclist am 19 Okt. 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)

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by