![]() |
创建3D矩阵
如何在MATLAB中定义3D矩阵?
例如大小为(8 x 4 x 20)的矩阵,还是将第3维添加到现有的2D矩阵? [B]回答:[/B] [B]创建3D矩阵[/B] A = zeros(20, 10, 3); %# Creates a 20x10x3 matrix [B]将第三维添加到矩阵[/B] B = zeros(4,4); C = zeros(size(B,1), size(B,2), 4); %# New matrix with B's size, and 3rd dimension of size 4 C(:,:,1) = B; %# Copy the content of B into C's first set of values 零只是制作新矩阵的一种方法。对于3D矩阵,另一个可能是A(1:20,1:10,1:3) = 0 。要确认矩阵的大小,可以运行: size(A)给出20 10 3 。 矩阵可以具有的维数没有明确的限制。 [url=https://stackoverflow.com/questions/2794191]更多&回答...[/url] |
所有时间均为北京时间。现在的时间是 01:06。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.