Hi there i have a question about for loops in matlab, i have a matlab exam very soon and am working through some questions and i don't understand how to reach the value for ires at the end of the loop. Hope someone can help.
Question:
Examine the following loops (without matlab) and determine the value in 'ires' at the end of each of the loops.
question1.
ires=0;
for index = 1:10
ires = ires+1;
end
question 2.
ires=0;
for index = 1:10
ires=ires+index;
end
question 3.
ires=0;
for index1=1:10
for index2=index1:10
if index2>6
break;
end
ires=ires+1;
end
end
Thankyou
Question:
Examine the following loops (without matlab) and determine the value in 'ires' at the end of each of the loops.
question1.
ires=0;
for index = 1:10
ires = ires+1;
end
question 2.
ires=0;
for index = 1:10
ires=ires+index;
end
question 3.
ires=0;
for index1=1:10
for index2=index1:10
if index2>6
break;
end
ires=ires+1;
end
end
Thankyou