I am having a problem with matrix dimension

1 回表示 (過去 30 日間)
Zain
Zain 2021 年 5 月 25 日
編集済み: Zain 2021 年 5 月 25 日
Hello,
I guess the problem is with y (line 147) as its not taking value from section %% output y.

回答 (1 件)

Jan
Jan 2021 年 5 月 25 日
編集済み: Jan 2021 年 5 月 25 日
Your y and yref are defined as globals, but they do not get a value anywhere. Therefore I get this error message running your code:
A1*x + B*(u)*x + Gv
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of
columns in the first matrix matches the number of rows in
the second matrix. To perform elementwise multiplication, use '.*'.
because u is the empty matrix.
This is the typical debugging horror, if you use global variables. Avoid this bad programming practice to get maintainable code.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by