MATLAB Answers

Sumit D
0

How to get back a three dimensional matrix using cat command?

Asked by Sumit D
on 16 Sep 2018 at 12:58
Latest activity Answered by Image Analyst
on 16 Sep 2018 at 14:00

I am trying to use cat function to reconstruct a 3 dimensional matrix after squeezing it to 1 dimension. How to use cat function in the for loop below?

for i=1:100; for j=1:50;

      uu=squeeze(u(i,j,:));      
      data{i,j}=uu; 
      uuf=cat(3,data{:,:});
    end
end

  0 Comments

Sign in to comment.

1 Answer

Answer by Image Analyst
on 16 Sep 2018 at 14:00

Try

uuf = cat(3, uu, uu, uu);

  0 Comments

Sign in to comment.