disp error: Dimensions of matrices being concatenated are not consistent.
2 ビュー (過去 30 日間)
古いコメントを表示
Q_output =
1.0e+03 *
0.0181 0.0011 0.0125
1.1500 0.4000 0.2000
0.0119 -0.0011 0.0175
-0.4000 -0.2000 -0.8000
M=1:3;
I want to display the two matrices above in a table so M is a column before Q_output. I tried disp([M',Q_output]), but I get the following error message
"Error using horzcat
Dimensions of matrices being concatenated are not consistent."
How do I fix it?
Q_output =
1.0e+03 *
0.0181 0.0011 0.0125
1.1500 0.4000 0.2000
0.0119 -0.0011 0.0175
-0.4000 -0.2000 -0.8000
M=1:3;
I want to display the two matrices above in a table so M is a column before Q_output. I tried disp([M',Q_output]), but I get the following error message
"Error using horzcat
Dimensions of matrices being concatenated are not consistent."
How do I fix it?
0 件のコメント
回答 (1 件)
Star Strider
2017 年 4 月 8 日
You can’t.
You can have ‘M’ as a row above ‘Q_output’, but since the lengths of ‘M’ and the row length of ‘Q_output’ are not equal, you cannot concatenate them horizontally.
This is the best you can do:
Result = [M; Q_output]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!