Merge columns and export to a text file
2 views (last 30 days)
Show older comments
Commented: BN on 10 Mar 2021
I have array like that:
AB = [
I need to convert it to the .txt (MS-DOS) in this form:
But there are two problems;
Firstly when I try to merge them using this code:
AB = char(compose('%0.f,%0.f', AB));
I observe that the decimal part didn't include in. for instance, I have -0 incorrect values in the new AB.
Secondly, when I try to export them in a text file, I see some blank space after each row, for example:
" 15.5000,4.3000 "
But I don't want the " symbol and also blank spaces in the text file.
I tried everything I knew, but it's isn't accomplished well, So if anyone knows the solution, I would be grateful.
ANKUR KUMAR on 10 Mar 2021
Focusing on "I need to convert it to the .txt (MS-DOS) in this form:" in your question, this chunck of code might help you.
AB = [
Attached the test.txt file for your reference.
More Answers (0)
Find more on Characters and Strings 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!