print value of i if the logical statement is TRUE

2 vues (au cours des 30 derniers jours)
SALMAN KHAN
SALMAN KHAN le 21 Avr 2021
Commenté : SALMAN KHAN le 21 Avr 2021
If I have to print the value of i , when the logical statement is correct, where X and Y are vertices or triangles.. anyone please let me know. thanks
xp = 0; yp = 0;
for i = 1:length(T)
xT = X(T(i,:));
yT = Y(T(i,:));
[in,on] = inpolygon(xp,yp,xT,yT);
end

Réponse acceptée

Jonas
Jonas le 21 Avr 2021
Modifié(e) : Jonas le 21 Avr 2021
if in
disp(i)
end

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by