Error using == Matrix dimensions must agree.
조회 수: 1 (최근 30일)
이전 댓글 표시
i have message error in matlab : Error using == Matrix dimensions must agree.
Error in Pengujian (line 39) [m,n] = find(output==target); please help me what can i do?
댓글 수: 3
Walter Roberson
2018년 2월 26일
Your net is not returning one result for each input, or else it is returning a column vector which you are trying to compare to a row vector. I suspect that is the problem, that you will need to transpose one of the two to compare them.
답변 (1개)
Walter Roberson
2018년 2월 26일
Assuming that you are trying to find the indices of each value of output within the matrix target, then:
[tf, idx] = ismember(output, target);
m = zeros(size(output));
n = zeros(size(output));
[m(tf), n(tf)] = ind2sub( size(target), idx(tf) );
Any value that does not appear within target will have m and n pairs of 0.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!