Small Problem with 'if' statement and array index
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello
I have a rather simple problem that I can not overcome. The problem I am facing is that I have an 'if' statement that I want to be executed only for one line of a matrix array (cell array).
I tried something like this, but doesn't work
if Seg_Out_1{1,:}==true .....
This one gives me an error 'Too many Input Arguments'. Is this the right approach, or should I do something complete different ???
Thank you in advance very much !
0 comentarios
Respuestas (4)
Wayne King
el 29 de Abr. de 2012
This is a matrix as the first element of a cell array?
If so (and if by line you mean row), then you want to address that by Seg_out{1}(1,:)
Seg_out = cell(2,1);
Seg_out{1} = ones(2,2);
if (Seg_out{1}(1,:) == [1 1])
% or isequal(Seg_out{1}(1,:),[1 1])
disp('true');
else
disp('false');
end
0 comentarios
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!