filtering result in matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ali hassan
am 30 Sep. 2020
Bearbeitet: ali hassan
am 1 Okt. 2020
this is a set of possible solutions i get from my code.but i only need three values but i get 6 possible solutions.i know that my solution can neither be negative nor it can be complex and it should show only accepted answer after ignoring other solution
there are 6 possible solutions but only three are right. now how to use loop maybe to ignore left entries as it is negative and it should only display right entries as solution
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 30 Sep. 2020
possibleSol(:, all(possibleSol>0 & imag(possibleSol)==0, 1))
1 Kommentar
Weitere Antworten (1)
Ameer Hamza
am 30 Sep. 2020
idx = any(possibleSol < 0);
possibleSol(:, idx) = []
It will remove any column with negative value in it.
2 Kommentare
Walter Roberson
am 1 Okt. 2020
idx = any(possibleSol < 0) | any(imag(possibleSol) ~=0);
possibleSol(:, idx) = []
Siehe auch
Kategorien
Mehr zu Line Plots 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!