Reference index in equation
Ältere Kommentare anzeigen
I am starting to write an .m file, and have the beginning code:
CapBasic = a0 + a1*T_evap(n) + a2*T_cond(n) + a3*T_evap(n)^2 + a4*T_evap(n)*T_cond(n) + a5*T_cond(n)^2 + a6*T_evap(n)^3 + a7*T_evap(n)^2*T_cond(n) + a8*T_evap(n)*T_cond(n)^2 + a9*T_cond(n)^3 ;
The variables T_evap and T_cond are actually an n x 1 vector, columns of data imported from Excel, with n being some very large number.
Also, I already defined the constants a0 to a9.
How can I create this new vector CapBasic since I receive the error:
"??? Undefined function or variable 'n'.
Error in ==> MTZ22JC4A_Sub at 4 CapBasic = a0 + a1*T_evap(n) + a2*T_cond(n) + a3*T_evap(n)^2 + a4*T_evap(n)*T_cond(n) + a5*T_cond(n)^2 + a6*T_evap(n)^3 + a7*T_evap(n)^2*T_cond(n) + a8*T_evap(n)*T_cond(n)^2 + a9*T_cond(n)^3 ;"
I tried to look up indices in the help but it is too confusing to figure out.
Thanks.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!