필터 지우기
필터 지우기

logic used in matlab

조회 수: 3 (최근 30일)
ali hassan
ali hassan 2020년 11월 18일
댓글: Steven Lord 2020년 11월 18일
what does this code mean.plzz explain step by step
code:
idx = any(possibleSol < 0) | any(imag(possibleSol) ~=0);
possibleSol(:, idx) = [];
  댓글 수: 1
ali hassan
ali hassan 2020년 11월 18일
plz help
https://in.mathworks.com/matlabcentral/answers/649193-array-forming-for-solution#answer_545693

댓글을 달려면 로그인하십시오.

채택된 답변

Steven Lord
Steven Lord 2020년 11월 18일
When you see a line of MATLAB code you don't understand, try breaking it into pieces. If you don't understand the pieces, break them up or look in the documentation.
idx = any(possibleSol < 0) | any(imag(possibleSol) ~=0); % the line
Breaking at the | operator gives pieces:
any(possibleSol < 0) % piece 1
any(imag(possibleSol) ~= 0) % piece 2
Breaking the first of those into pieces:
possibleSol < 0 % piece 1 part 1 = PP1
any( PP1 ) % piece 1 part 2
Do you understand piece 1 part 1? If not:
doc <
Do you understand what piece 1 part 2, calling any on piece 1 part 1, does? If not:
doc any
That tells you what piece 1 does. Do the same for piece 2, split it into parts. Then put the pieces back together: if you're not sure about the | operator:
doc |
  댓글 수: 2
ali hassan
ali hassan 2020년 11월 18일
thankyou sir for your efforts but i could'nt totally understand it.i could'nt understand doc part
Steven Lord
Steven Lord 2020년 11월 18일
If you don't understand what a function or operator in MATLAB does, look at its documentation page. You can open the documentation pages using the doc function. To open the documentation page for the any function, for example:
doc any

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Help and Support에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by