nicleo
Advanced Member level 2
Code:
When the following codes:
% [code 1]
k=5
clear all;
dummy=k
... were executed, Matlab showed an error as follows:
"??? Reference to a cleared variable k."
However, when the following codes:
% [code 2]
for i=1:5
i
clear all;
dummy=i
end
... were executed, Matlab did not show any error. The line dummy=i, when executed, was displayed as follows:
dummy = 0 + 1.0000i
Thank you very much