MatrixE1의 각 열에 대한 막대 그래프를 그려야합니다. 어떻게이 일을 할 수 있습니까? 이것은 내가 지금까지 쓴 것입니다. 어떤 도움이라도 대단히 감사합니다.행렬의 열 히스토그램을 그리는 방법은 무엇입니까?
% Create a random 5 x 3 matrix filled with random values between 0 and 10
a0 = 0;
b0 = 10;
r = a0 + (b0-a0).*rand(1,1);
matrixA = [randi([0 10]) randi([0 10]) randi([0 10]); randi([0 10]) randi([0 10]) randi([0 10]); randi([0 10]) randi([0 10]) randi([0 10]); randi([0 10]) randi([0 10]) randi([0 10]); randi([0 10]) randi([0 10]) randi([0 10])]
% Create identity matrix 3 x 3
matrixB = eye(3,3)
% Create new submatrix of A with the last 3 rows
matrixC = matrixA(end-2 : end, :)
% Pair wise multiplication of C and B
matrixD = times(matrixC, matrixB)
% Concatenate Matrix A and D
matrixE1 = [matrixA ; matrixD]
% Plot histogram of columns.
matrixColumn1 = matrixE1(1 : end , end-2: end-2);
matrixFColumn2 = matrixE1(1 : end, end -1 : end-1);
matrixFColumn3 = matrixE1(1 : end, end : end);
'hist()'를 시도 했습니까? – Jeon
무엇을 할 수 있습니까? hist (??). matrixE1의 모든 열에 대해 하나의 막대 그래프를 얻으려면 어떻게해야합니까? hist (matrixE1)를 수행해야합니까? –