3D Matrix manipulation

1 回表示 (過去 30 日間)
Nicholas Deosaran
Nicholas Deosaran 2020 年 9 月 14 日
回答済み: KSSV 2020 年 9 月 14 日
Hey everyone one!
I need some assitance with developing a 3x3x10 matrix with any numbers.
That writes the command that will tell you the dimensionsof the matrix (rows, cols, levels), and store the outputs of the command in MATLAB’s workspace as [m,n,o]
Thank you in advance !

採用された回答

KSSV
KSSV 2020 年 9 月 14 日
% to create random matrix
A = rand(3,3,10) ;
% To create random integers with in 100
B = randi(100,3,3,10) ;
% To make ones matrix
C = ones(3,3,10) ;
% To make zeros matrix
D = zeros(3,3,10) ;
% To save matrix in a loop
X = zeros(3,3,10) ;
for i = 1:10
X(:,:,i) = rand(3) ;
end
% To get the size of matrix
[m,n,p] = size(X) ;
size(X)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by