The program below gives the result n1=75 wheras I expect to get n1=25. What is my mistake?(adsbygoogle = window.adsbygoogle || []).push({});

[C O D E]

clc

clear all

n1=0;

for n=1:5

for m=1:5

n1=n1+m;

end

end

n1

[/C O D E]

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Unreasonable loop

Loading...

Similar Threads for Unreasonable loop |
---|

Mathematica Looping through vectorized functions for a piecewise solution |

Mathematica While Loop in Mathematica |

**Physics Forums | Science Articles, Homework Help, Discussion**