Filter löschen
Filter löschen

1) Given the following MATLAB for loop: for a= 1:6 b=a*3; end What is the value of b upon completion of the loop?

4 Ansichten (letzte 30 Tage)
1) Given the following MATLAB for loop:
for a= 1:6
b=a*3;
end
What is the value of b upon completion of the loop?
2) Given the following MATLAB for loop:
for a= 1:6
b=a*3;
end
Once the loop has completed, what is the value of a?
  1 Kommentar
James Tursa
James Tursa am 26 Mär. 2015
Bearbeitet: James Tursa am 26 Mär. 2015
Seriously, it would be less effort to simply copy and paste that loop into MATLAB than to create this Question. Just do it and see what the result is.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

James Tursa
James Tursa am 26 Mär. 2015
- Highlight all three lines of the for loop
- Press Ctrl-C
- Click on the MATLAB command window (the one with the >> showing)
- Press Ctrl-V
- Examine the values of a and b

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by