필터 지우기
필터 지우기

While loop not working properly

조회 수: 2 (최근 30일)
Amine Ben Ayara
Amine Ben Ayara 2016년 2월 8일
답변: Jos (10584) 2016년 2월 9일
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
Star Strider
Star Strider 2016년 2월 8일
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 2016년 2월 9일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jos (10584)
Jos (10584) 2016년 2월 9일
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!

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by