Matrix formulation with matrix multiplication and raising to N-power
2 次查看(过去 30 天)
显示 更早的评论
Hey guys,
I'm currently working on designing an MPC controller manually and for some reason I get an error defining a Matrix of 8x7 dimension such as :
B = [0.005;
0.1] and B_tilda corresponding to the new states with a prediction Horizon of N = 7 is in the screenschot attached. I keep getting this error :
I would really appreciate any help.
采纳的回答
Steven Lord
2022-7-5
编辑:Steven Lord
2022-7-5
If your B is in fact a 2-by-1 vector:
B = [0.005; 0.1]
then you cannot concatenate it horizontally with 0 as they don't have the same number of rows. [SL: removed an accidental repeat of the advice about "same number of rows."] If you defined a variable like this:
Z = zeros(size(B));
then this concatenation would be valid:
M = [B, Z; Z, B]
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Predictive Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!