How to generate a logical indexing based on any element of a multiple line matrix
Show older comments
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,
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!