Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do you do these problems by hand?

조회 수: 1 (최근 30일)
Mohamed Amine Mouajib
Mohamed Amine Mouajib 2019년 5월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
So I'm supposed to do these by hand and only print the answer on Matlab. This is a homework we were assigned a long time ago but I never did it nor has the solution been posted for it. I have a test tomorrow and I really would like to know how to do them by hand.
1)
x = 10;
if round(x/5) == x/5 x = 2 * x + 4;
elseif x == 10 x = 4 * x;
else x = 0;
end
---------------------
2)
x = 10;
if round(x/3) == x/3 x = 2 * x + 4;
elseif x == 10 x = 4 * x;
else x = 0;
end
-------------------------
3)
x = 9;
if round(x/4) == x/4 x = 2 * x + 4;
elseif x == 4 x = 4 * x;
else x = 0;
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 5월 13일
You use your knowledge of MATLAB operations.
What does / do? What does round() do? What does == do?
In the circumstance that you have a chain
if condition1; result1;
elseif condition2; result2;
else result3;
end
then if condition1 and condition2 and "else" are all true, then what would the outcome be?

답변 (0개)

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by