Displaying a count once per second. The following script displays an incremental count once per second. Cntrl-C terminates the infinite loop the Find the error in the script.

i=0;
while(1) % infinite loop

disp(i)

pause(1)

i = i+2;


Solution
i=0;
while(1) % infinite loop

disp(i)

pause(1)

i = i+1; % <-

Trades & Technology

You might also like to view...

A cross brace labeled as an HSS is a(n) _____.

a. hard service structure b. hot steel surface c. hollow structural section d. bearing pile structure

Trades & Technology

Most mohair comes from castrated males raised exclusively for their hair

Indicate whether the statement is true or false

Trades & Technology

Most service information specifies that a ________ be used when testing a wide band oxygen sensor

A) HO2S disconnect bypass tool B) Generic scan tool C) Factory scan tool D) Vacuum hose

Trades & Technology

A baseball with a mass of 0.145 kg is thrown by a pitcher at a velocity of 42.0 m/s. Determine the kinetic energy of the baseball.

Given: m = 0.145 kg; V = 42.0 m/s What will be an ideal response?

Trades & Technology