Error when trying to suppress the output of vertcat
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello!
I've run into an odd error recently when trying to use vertcat. I have two matrices A and B, both of type 'double'; size(A) = 6713x1296 and size(B) = 10000x1296. I've repeatedly checked these sizes and they only differ in the number of rows. I want to vertically concatenate these. When I use vertcat or just [A;B] in the command line, it works just fine. I can also suppress the output using ;. But when this is executed in the main program, it only works if I don't suppress the output with ; (Both vertcat and [A;B] works if I don't suppress the output). If I do put a ; at the end of the statement, I get the error: Error using horzcat Dimensions of matrices being concatenated are not consistent.
Even though the dimensions clearly are consistent and all that is different is I decide to put a ; to suppress my output.
A little more info: The matrices A and B are essentially HoG features that I compute for positive and negative face images respectively using vl_hog. I compute these in two separate functions and return the values to the main program. My MATLAB version is R2014a. I've not had this issue with vertcat before. Even though it works if I don't suppress the output, it's just painful to wait for the entire 16713x1296 data values to print.
Thanks for helping!
채택된 답변
Jan
2015년 11월 11일
This sounds magic. Whenever a magic problem has been described in the forum, the behavior was caused by another bug at an unexpected location.
Does the problem appear, while you use the debugger? Or if you disable the JIT:
feature('Accel', 'off');
feature('JIT', 'off');
So please set this code before the failing line:
whos('A', 'B');
size(A)
size(B)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!