How to generate a logical indexing based on any element of a multiple line matrix
Ältere Kommentare anzeigen
Hi all,
I am struggling to produce a logical matrix based on a multiple line matrix. According to the example on the code below:
%
% A = [1048575x1];
% B = [40x1]; contains indexes to evaluate each line of A. If any element
% of A == any element of B, I would like to mark a logical YES (1). Elseif
% NO (0);
% As a result I would like to replace by "-9999" where is a logical truth
% I tried the following routine, but it is wrong:
for i=1:1:length(B)
if A == stops_start_id(i);
A = -9999;
end
end
%
Thank you for your time,
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!