plz anyone solve the following question for me in matlab and reply quick.regards
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
if X=[-4 -1 0 2 10] and Y=[-5 -2 2 5 9],find the index of elements of "X" that are greater than corresponding value of "Y".
Antworten (2)
Rick
am 5 Nov. 2012
Bearbeitet: Rick
am 5 Nov. 2012
If the scale of X and Y is the same, you could use a "for" loop to go through every element.
for i=1:numel(X)
if X(i) > Y(i)
% Do something
end
end
or you could use the function "gt"
type "help gt" in matlab without quotes for more details
0 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!