jessysmith8109 jessysmith8109
  • 23-08-2019
  • Computers and Technology
contestada

convert for loop to while loop, that is the script

z1=zeros(10);
for x=1:10
for y=1:10
z1(x,y)=x^2-3*y
end
end
z1

Respuesta :

ExieFansler ExieFansler
  • 04-09-2019

Answer:

To convert for loop to while loop we have to first declare and initialize the integers or variables that will work as an counter.

script will be

z1=zeros(10);

x=1

while x<10

y=1

while y<10

z1(x,y)=x^2-3*y

y=y+1

end

x=x+1

end

z1

Remember that we have to update the counter every time that we not need to be done for loop.

Answer Link

Otras preguntas

6. The unit circle with center at the origin is a relation but not a function. Find the two functions which are semicircles of the unit circle, and determinethe
The density of aluminum is 2.70 g/mL. What is the mass of a 15.9 cm X 11.6 cm X 7.3 cm block of aluminum?
find domain of f(x)=1/√x^2+1
what are sand dunesif you answered this question first you will be marked as the brainliest and I will also follow you ! ​
where did they start water conservation in tamil nadu . short answer
If 8.51÷2.3=3.7, find the value of 85.1÷ 2.3​
Please help me. =======
How many gallons, quarts, and pints are in 72 cups (not all together)
Define Histology will give BRAINLEIST
helllllppppppppppppp I WILL GIVE BRAINLIEST​