Clear Filters
Clear Filters

How to get rid of the error: Error using horzcat. Dimensions of matrices being concatenated are not consistent

15 views (last 30 days)

Answers (1)

Image Analyst
Image Analyst on 27 May 2024 at 17:31
In general, this error means that the matrix you're trying to concatenate on the right hand side of your existing matrix does not have the same number of rows as your existing matrix.
C = [A, B]; % A and B MUST have the same number of rows or you get an error.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!