How to reconstruct a 3D matrix from a vector?
显示 更早的评论
I have a 3D matrix A1 filled with numbers. I accessed a specific element across all the sheets to filter it. I need to do this for all the elements and create a new 3D matrix A2 of the same dimensions as A1. This is the code I’ve got so far after referring to https://in.mathworks.com/matlabcentral/answers/15463-how-to-create-a-3d-matrix-using-the-2d-matrices. The problem is that now I get the same numbers on all the sheets for A2.
The code is like this
%A1 is a 5x10x7 matrix
C1=randi(1,5,10);A2=zeros(5,10,7);
for i=1:5
for j=1:10
T2 = reshape(A1(i,j,:), [],1);
k=smoothdata(T2,'movmean');
A2(i,j,:)=k(A1(i,j));
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!