- the first row has 3 elements
- the second row has 3 elements
- the third row and 1 element.
Why do I get the error Dimensions of arrays being concatenated are not consistent?
1 次查看(过去 30 天)
显示 更早的评论
This is my code. How can I fix this problem?



0 个评论
采纳的回答
Cris LaPierre
2020-12-30
I'm going to guess it's because you are trying to combine 2+ arrays that have a different number of columns. Specifically, when you create b, you are combing three rows.
All rows must have the same number of elements in order to concatenate them together vertically.
更多回答(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!