What is the different between Break and Return?
<p>I have two Matlab codes that I want to determine a matrix is symmetric or not? I have used nested "for loops". Furthermore:</p>

<ol>
<li>In the first code, I've got to exit of the program twice
''break''. </li>
<li>In the second code, I've got the command ''Return'' to
    exit of the program.</li>
</ol>

<p><strong>Is there any problems between the Break and Return?</strong></p>

<p>I have attached my codes.</p>

<p>First code:</p>

<pre><code>clc
clear all
A=input('Please enter your matrix=')
n=length(A);
temp=0;
for i=1:n-1
    for j=i+1:n
    if A(i,j)~=A(j,i)
       temp=1;
       break
    end
    end
    if temp==1
       disp('Matrix A is not symmetric.')
       break
    end
end
</code></pre>

<p>Second code:</p>

<pre><code>clc
clear all
A=input('Please enter your matrix=')
n=length(A);
temp=0;
for i=1:n-1
    for j=i+1:n
    if A(i,j)~=A(j,i)
       disp('Matrix A is not symmetric.')
       return
    end
    end
end
</code></pre>