outputing data into a txt file

hello everyone,
I was wonderin how to open a file with the name "data.txt" and then outpout the values
a=25,27,24,36
b=19,20,22,17
c=12,34,56,33
just with commands. I don't want to open the file manually and copy and paste. Thank you in advance

 Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 2 May 2016
Edited: Azzi Abdelmalek on 2 May 2016
a=[25,27,24,36]
b=[19,20,22,17]
c=[12,34,56,33]
M=[a;b;c]
dlmwrite('data.txt',M)

More Answers (0)

Categories

Find more on Prepare Model Inputs and Outputs 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!