Kann jemand erklären die zwei Zeilen des Codes, die unten hervorgehoben werden, die repmat
verwenden? Dies wird documentation for learning data analysis direkt von dem MathWorks genommen:Matlab: repmat Code Erklärung
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
Könnte jemand die X = repmat(...)
Linie mir das erklären? Ich weiß, dass es für die 1 und 2 Standardabweichungslinien geplottet wird.
Auch habe ich versucht, die Y = ...
Zeile kommentieren, und die Handlung sieht genau das gleiche, also was ist der Zweck dieser Linie?
Dank