MATLAB Answers

write double class to .txt file

150 views (last 30 days)
ha ha
ha ha on 21 Jun 2018
Edited: ha ha on 22 Jun 2018
Let' say , I have the data in Matlab with the result is ha=14x3 double.
ha=[ 6.74483465234e+05 1.512013286060e+06 -11.6250
6.74483565235e+05 1.512013586059e+06 -11.1250
6.74483665235e+05 1.512013186059e+06 -11.6150
............................................................]
How can I convert "ha" to the file with extension file name .txt?

Accepted Answer

ha ha
ha ha on 21 Jun 2018
Edited: ha ha on 22 Jun 2018
dlmwrite('output.txt', ha, 'delimiter','\t','newline','pc','precision',13);
where "precision": using a precision of 13 significant digits. https://www.youtube.com/watch?v=PGPBCAPd9Vg&feature=youtu.be
  1 Comment
Walter Roberson
Walter Roberson on 21 Jun 2018
Two steps are not needed. If you already have ha then just the dlmwrite() would be needed.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 21 Jun 2018
save YourFileNameGoesHere.txt ha -ascii -double
  3 Comments
ha ha
ha ha on 21 Jun 2018
thank @Walter Roberson

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!