How to create multiple .dat files using matlab?

1 visualizzazione (ultimi 30 giorni)
vigneshwaran K
vigneshwaran K il 20 Ago 2019
Commentato: vigneshwaran K il 23 Ago 2019
Kindly assist me in creating multiple .dat files with the name of the variables in which the data file to be created.
Eg: For a=1:1:10, i need to create the dat file of .........._1.dat,........._2.dat, ......._3.dat, and upto ........_10.dat
Thank you in advance.
  1 Commento
vigneshwaran K
vigneshwaran K il 23 Ago 2019
I use to write the datas in dat files anfd i would like to close then i have to create the second dat file, writing the datas with particular variable(constant for each .dat files) and that constant value has to be attached as the name of the dat file.
For example, variale is 1,2,3,4,5. I have to create 1.dat then i ll write other x and corresponding y for that variable 1. then i have to close 1.dat . Then this process has to continue for the remain variables say 1,3,4,5. Dat files will be with the name of variable_1.dat , variable_2.dat. variable_3.dat. variable_4.dat. variable_5.dat

Accedi per commentare.

Risposte (1)

KSSV
KSSV il 20 Ago 2019
for i = 1:10
filename = strcat(num2str(i),'.dat')
end
  1 Commento
vigneshwaran K
vigneshwaran K il 23 Ago 2019
Thank you for your answer. But i use to write the datas in dat files anfd i would like to close then i have to create the second dat file, writing the datas with particular variable(constant for each .dat files) and that constant value has to be attached as the name of the dat file.
For example, variale is 1,2,3,4,5. I have to create 1.dat then i ll write other x and corresponding y for that variable 1. then i have to close 1.dat . Then this process has to continue for the remain variables say 1,3,4,5. Dat files will be with the name of variable_1.dat , variable_2.dat. variable_3.dat. variable_4.dat. variable_5.dat

Accedi per commentare.

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by