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 = ...
這一行,而且情節看起來完全一樣,那麼這一行的目的是什麼?
由於