How to write while a set Q is not empty do the following in matlab?
조회 수: 12 (최근 30일)
이전 댓글 표시
I want to write this algorithm in matlab:
while Q ≠ ϕ, do
-
-
-
end(do)
댓글 수: 0
채택된 답변
John D'Errico
2020년 2월 17일
What function tells you if a vector is empty? (Hint: isempty)
What do you want? Not empty. So what is the logical negation operator in MATLAB? (Hint: ~)
Given that, what would ~isempty(Q) do? How would it help you?
Finally, read the help for while, since it looks like you don't know the basic syntax for a loop in MATLAB.
Essentially, you need to learn MATLAB. Start with the getting started tutorials.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!