matlab program error

function [nn, xx, xmu, xstd] = Debug_Test (x)
% of the experimental procedure used for debugging
xmu = mean (x);
xstd = std (x);
[nn , xx] = hist (x);
if nargout == 0
barzzy0 (nn, xx, xmu, xstd)
end

function barzzy0 (nn, xx, xmu, xstd )
Clf,
bar (xx, nn); hold on
Ylimit = get (gca, 'YLim');
yy = 0:Ylimit (2);
xxmu = xmu * size (yy);
xxL = xxmu / xmu * (xmu-xstd);
xxR = xxmu / xmu * (xmu + xstd);
plot (xxmu, yy, 'r', ' Linewidth ', 3)
plot (xxL, yy,' rx ',' MarkerSize ', 8)
plot (xxR, yy,' rx ',' MarkerSize ', 8), hold off

Then, in the command window in the following order:
randn ( 'seed', 1), x = randn (1100); Debug_Test (x)

process of debugging errors, summing up the process of debugging , And pointed out that the correct procedures for the wrong statement

Leave a Reply