0
任何人都可以解释下面突出显示的两行代码,它使用repmat
?Matlab:repmat代码解释
bin_counts = hist(c3); % Histogram bin counts
N = max(bin_counts); % Maximum bin count
mu3 = mean(c3); % Data mean
sigma3 = std(c3); % Data standard deviation
hist(c3) % Plot histogram
hold on
plot([mu3 mu3],[0 N],'r','LineWidth',2) % Mean
% --------------------------------------------------------------
X = repmat(mu3+(1:2)*sigma3,2,1); % WHAT IS THIS?
Y = repmat([0;N],1,2); % WHY IS THIS NECESSARY?
% --------------------------------------------------------------
plot(X,Y,'g','LineWidth',2) % Standard deviations
legend('Data','Mean','Stds')
hold off
谁能解释X = repmat(...)
行对我说:这是直接从MathWorks公司documentation for learning data analysis采取?我知道它将被绘制为1和2的标准偏差线。
此外,我试着评论出Y = ...
这一行,而且情节看起来完全一样,那么这一行的目的是什么?
由于