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!
