cant find whats wrong

조회 수: 1 (최근 30일)
Sagar AS
Sagar AS 2015년 7월 1일
편집: Sagar AS 2015년 7월 1일
??? Error using ==> eq Matrix dimensions must agree.
Error in ==> try1>compute_Callback at 213 if gen_gate(end,1:2^n)==f
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> try1 at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)try1('compute_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
>>

채택된 답변

Guillaume
Guillaume 2015년 7월 1일
The error message is fairly clear. You're comparing two matrices of different size with == (also called eq). == only works with matrices of the same size and also return a matrix of the same size which tells you which elements are equal.
Possibly, you should have used isequal instead. This will return false if the matrices are different size or if any of the elements differ and return true only when the two matrices have exactly all the same elements.
if isequal(gen_gate(end,1:2^n),f)
  댓글 수: 1
Sagar AS
Sagar AS 2015년 7월 1일
편집: Sagar AS 2015년 7월 1일
thank you that worked,but now i cant see the output in the sense the GUI is not working even if there are no errors

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by