Looping for finding the first index satisfying the statement through cells, when the results of "find" is an empty matrix, the loop stops with the error "Improper assignment with rectangular empty matrix"
How can I impose to ignore that, assigning to the output matrix a NaN value, and complete the loop?
% a 282
%c=30
% C{c,282}
for i=1:a
A(i)=find(C{:,i}>100,1,'first')
if isempty (find(C{:,i}>100))
A(i)=NaN
else
A(i)=A(i)
end
end
Thanks
How can I impose to ignore that, assigning to the output matrix a NaN value, and complete the loop?
% a 282
%c=30
% C{c,282}
for i=1:a
A(i)=find(C{:,i}>100,1,'first')
if isempty (find(C{:,i}>100))
A(i)=NaN
else
A(i)=A(i)
end
end
Thanks