cant find whats wrong
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sagar AS
el 1 de Jul. de 2015
??? 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
>>
0 comentarios
Respuesta aceptada
Guillaume
el 1 de Jul. de 2015
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 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!