我有一个9x3矩阵,我细分为三(3)3x3矩阵。现在我想创建一个for循环函数,将每个3x3矩阵存储到一个变量中。将3x3矩阵存储在变量for循环中
X=reshape(1:27,3,9)'; % sample 9x3 matrix
xx = mat2cell(X,[3,3,3],3); % subdivide X matrix into 3x3 cell matrix
for i:1:3
x(i) = xx{i,1}; %store the three cells into x1 x2 and x3 matrix
end
我知道这并不是它在matlab中的工作原理,而仅仅是为了展示我想获得的功能。
你几乎肯定不想这样做。你想做什么需要多个变量? – nkjt
我想实现的是, –