Borrar filtros
Borrar filtros

While loop not working properly

2 visualizaciones (últimos 30 días)
Amine Ben Ayara
Amine Ben Ayara el 8 de Feb. de 2016
Respondida: Jos (10584) el 9 de Feb. de 2016
I have written this while loop and my final output should be a matrix of at least 14680 rows ( by the minimum), by 3 columns. However for some reason, The simulation stops at row 6428 and I get some error: " Error using horzcat Dimensions of matrices being concatenated are not consistent. " I am not even using horzcat anywhere in my code. Anyone have any suggestions on how to overcome this issue, PLEASE~!
  2 comentarios
Star Strider
Star Strider el 8 de Feb. de 2016
You don’t have to be using horzcat. One of the functions you’re calling likely uses it.
Seeing your code would help.
KSSV
KSSV el 9 de Feb. de 2016
You tried to concatenate two vectors/matrices which are of different dimensions. Eg. If you concatenate column vector with row vector or vice verse you will get that error. Check the dimensions of the arrays/matrices you are concatenating. They must be of same dimension.

Iniciar sesión para comentar.

Respuestas (1)

Jos (10584)
Jos (10584) el 9 de Feb. de 2016
I am pretty sure you do use horzcat, albeit in the form [A B].
The error results from code similar to this:
A = 1:3 ; B = A.' ; % test data
C = [A B] % -> horzcat error!

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by