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

1 visualización (últimos 30 días)
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 !!

Respuesta aceptada

the cyclist
the cyclist el 19 de Oct. de 2014
Editada: the cyclist el 19 de Oct. de 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)

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by