How to create multiple .dat files using matlab?

2 visualizaciones (últimos 30 días)
vigneshwaran K
vigneshwaran K el 20 de Ag. de 2019
Comentada: vigneshwaran K el 23 de Ag. de 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 comentario
vigneshwaran K
vigneshwaran K el 23 de Ag. de 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

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 20 de Ag. de 2019
for i = 1:10
filename = strcat(num2str(i),'.dat')
end
  1 comentario
vigneshwaran K
vigneshwaran K el 23 de Ag. de 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

Iniciar sesión para comentar.

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by