Reference index in equation
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!