How to print a 3D matrix to a text file?
    17 ビュー (過去 30 日間)
  
       古いコメントを表示
    
How can I save the following 3D matrix in a text file using MATLAB?
Nx = 4;
Ny = 4;  
Nz = 4;
x   = (0:Nx-1)/Nx*2*pi;         
y   = (0:Ny-1)/Ny*2*pi;
z   = (0:Nz-1)/Nz*2*pi;
[X,Y,Z] = meshgrid(x,y,z);
%how to save X, Y, and Z in text files?
3 件のコメント
採用された回答
  Sailesh Kalyanapu
    
 2022 年 10 月 11 日
        As per my understanding, you are trying to save a 3D Matrix in a text file using MATLAB. 
You could use writematrix() function to writes a homogeneous array to a comma delimited text file. 
You can also refer to this MATLAB Answers post for saving a 3D matrix using MATLAB’s ‘save()’ function: 
For more information on ‘writematrix’ and ‘save’ functions, please refer to the below links to their respective documentations: 
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Text Files についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


