No BSD License  

Highlights from
ChebyshevTools

from ChebyshevTools by Michael Watson
Tool box for solving ODE/PDEs using spectral Chebyshev differentiation matrices.

Y=cheb2phys3(X);
function Y=cheb2phys3(X);

% 3d transform chebyshev to physical space

for p=1:3
   [M,N,P]=size(X);
   for j=1:N
       for k = 1:P
           X(:,j,k)=cheb2phys(X(:,j,k));
       end
   end
   X=permute(X,[2,3,1]);
end
Y=X;

% [M,N,P]=size(X);
% 
% Z=zeros(M,N,P);
% Z2=zeros(N,P,M);
% Z3=zeros(P,M,N);
% 
% %x transform
% for j=1:N
%    for k = 1:P
%       Z(:,j,k)=cheb2phys(X(:,j,k)); 
%    end
% end
% 
% %y transform
% Z=permute(Z,[2,3,1]);
% for k=1:P
%    for i=1:M
%       Z2(:,k,i)=cheb2phys(Z(:,k,i));
%    end
% end
% 
% %z transform
% Z2=permute(Z2,[2,3,1]);
% for i=1:M
%    for j=1:N
%       Z3(:,i,j)=cheb2phys(Z2(:,i,j)); 
%    end
% end
% 
% Y=permute(Z3,[2,3,1]);

Contact us at files@mathworks.com