How do I save data to a file in Matlab?

I have three different variables that are 400x1 doubles and I would like to save this data in one file that is delimited by a tab. Please help! Thanks!

Answers (1)

dlmwrite('sample.txt',[a,b,c],'delimiter','\t') %a,b and c are variables

4 Comments

filename1= ('s%d.s2p', k);
dlmwrite(filename1,[xf,af,bf],'delimiter','\t') %xf,af and bf
This is the code I used when trying to implement your solution.
I still get an error... I think it's becaus how I'm trying to iterate the text file name in the loop. Any suggestions?
Thanks!
I am looping through multiple data files processing and attempting to save the data into new data files, so that is why it is in a loop. Any advice?

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Asked:

on 14 Nov 2018

Commented:

on 14 Nov 2018

Community Treasure Hunt

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

Start Hunting!