Higher rank tensor: how to export and read it as a file?
6 views (last 30 days)
Show older comments
Hello,
I have a rank-3 tensor, say simply
tensor=zeros(dA,dB,dC);
where dA, dB and dC are the respective dimensions. I like to export it as a file and later on import it again to continue some calculation in another Matlab script. How do I do this? As far as I see, dlmwrite, cswwrite and writematrix only work for matrices and give me some error saying "transpose not defined...".
Many thanks!
0 Comments
Answers (1)
Divyam
on 7 Jun 2023
If you have access to the tensor toolbox, you can simply use the export_data function to export the tensor data and save it to a file. The following command should work in your case.
export_data(tensor, "tensor_data.tensor")
For more information on exporting and importing tensor data using the tensor toolbox, you can refer to this article: Importing and Exporting Tensor Data (tensortoolbox.com)
2 Comments
See Also
Categories
Find more on Data Import and Export in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!