Download Release Notes for Release 12

Transcript
Upgrading from an Earlier Release
causes an incorrect branch from the try to the line, x = 5. The for loop is not
terminated, in this case.
In MATLAB 6.0, execution of the break within the try – catch terminates the
for loop. The next line executed following the break is y = 10.
for i = 1:10
try
<statement>
break
catch
<statement>
end
x = 5
end
y = 10
% Break to here in MATLAB 5
% Break to here in MATLAB 6.0
Specifying Field Names with SETFIELD and GETFIELD
The setfield and getfield functions set and get the value of a specified field
in a MATLAB structure array. In MATLAB 5, you could use the following
undocumented syntaxes to set fieldn to the value, newvalue and to read back
that value.
setfield(structurename.field1.fieldn,newvalue)
getfield(structurename.field1.fieldn)
These syntaxes are not supported in MATLAB 6.0. You should use the
following instead.
setfield(structurename,'field1','fieldn',newvalue)
getfield(structurename,'field1','fieldn')
For example,
a.b.c = 7;
a = setfield(a,'b','c',10);
getfield(a,'b','c')
ans =
10
2-51