filtering result in matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
Ameer Hamza
2020년 9월 30일
idx = any(possibleSol < 0);
possibleSol(:, idx) = []
It will remove any column with negative value in it.
댓글 수: 2
Walter Roberson
2020년 10월 1일
idx = any(possibleSol < 0) | any(imag(possibleSol) ~=0);
possibleSol(:, idx) = []
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!