MATLAB O/X QUIZ


MATLAB O/X Quiz
Answer BEFORE Googling!
  1. An infinite loop can be made using "for".
  2. "A == A" is always true.
  3. "round(2.5)" is 3.
  4. "round(-0.5)" is 0.
Chen Lin
Chen Lin 2024 年 2 月 23 日
This is a fun way to share and learn some quick tips!
Stephen23
Stephen23 2024 年 2 月 23 日
TFTF
the cyclist
the cyclist 2024 年 2 月 23 日
I did not realize that the most obvious way to attempt #1 will give a warning:
Warning: Too many FOR loop iterations. Stopping after 9223372036854775806 iterations.
I have not figured out how to do that one, and I am leaning toward False. (It's trivial with a while loop, of course.)
Stephen23
Stephen23 2024 年 2 月 28 日 (編集日時: 2024 年 2 月 28 日)
"It's trivial with a while loop, of course."
When somone demonstrates an infinite WHILE-loop, then I will very happily concede that an "infinite" FOR-loop is not currently possible. Because apparently an infinite WHILE-loop is "trivial", I look forward to this demonstration soon... (although I fear that I might not survive the heat death of the universe to view preliminary results).
Rik
Rik 2024 年 2 月 24 日

I'm also leaning towards false, since even if the number of iterations is functionally infinite (and 9,223,372,036,854,775,806 is), I can only think of ways that result in a finite number of iterations.

タグ