How to create tab-separated .txt using num2str
显示 更早的评论
I initially converted some .mat files to tab-separated .txt using dlmwrite, but for some reason the values were not recognized on other platforms, and shows "NaN or non numerical error" instead. I was thinking that num2str could possibly bypass this issue. Here is what I have, but where do I add the tab-separated component?
% Length
load('Lengths.mat')
Len = num2str(DistMatrix)
diary('Lengths.txt')
disp(Len)
diary off
% Weights
load('Weights.mat')
Wei = num2str(CatMatrix)
diary('Weights.txt')
disp(Wei)
diary off
2 个评论
Adam Danz
2019-5-15
What is "DistMatrix" ? A matrix? A column vector? A row vector? A numeric scalar? Same with CatMatrix?
Why not use a function that is designed to write to text rather than using diary?
Wei Wen Chen
2019-5-15
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
