Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

suspect

function [mistaken, position] = suspect( initials, familiar )
j=1;
k=1;
position =[];
mistaken ={};
for i=1:length(familiar)
if familiar(1,i)== 0
initials(1,i)
mistaken{1,j}=initials{1,i};
j=j+1;
end
if familiar(1,i)== 1
position(1,k)=i;
k=k+1;
end   
end

%%---------------------------------------------------------------------

Now how to call the function

 A={'AV ','AL ','WL ','NB ','EB ','AS '}; % Intialise the A as cell not matrix or vector

l=[1, 1,0,1,1,0];
l=logical(l); % convert l to logical

[m,n]=suspect(A,l); % to call the function

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.