Save one and after data in one programme

Hi All I just need help that I am working on a programme in which i have a loop and loop is repeated 10 to 11 times i just want to save the results every time in a new file it means when the programme end i have 11 files Anybody please help how to store 11 different files in a single programme Thanks in advance

Respuestas (1)

OCDER
OCDER el 7 de Ag. de 2018
Editada: OCDER el 7 de Ag. de 2018
Here's a simple case for writing 11 files. Without details in your question, you'll have to start from this template and modify it to fit your needs.
for j = 1:11
Data = rand(100, 10);
FileName = sprintf('myfile_%d.csv', j);
csvwrite(FileName, Data)
end

5 comentarios

John Hock
John Hock el 9 de Ag. de 2018
hi thanks for your time @ OCDER i am just working on a programmme in which i have lets say 100 values i just picked 10 values and then do some processing on it and create an audio file and save that audio file and then again select next 10 values and again same process But i am facing the issue that how to save all the different files using 1 loop
OCDER
OCDER el 9 de Ag. de 2018
Can you show the loop code you have? Do you want to read and modify N files, or read N files and save to 1 file?
John Hock
John Hock el 11 de Ag. de 2018
in a loop i want to read N values(10 values at a time ) and write them in N files
John Hock
John Hock el 11 de Ag. de 2018
i have data with 100 values(1 2 3 4 .........).I will read first 10 values using a loop and then put these values in a audio file lets named as test.wav When loop run for the second time it will read next 10 values and again put in audio file named as test.wav(while updating the old file made at first time) I just want that every time when loop runs it store the audio in a new file not updating the old file SO at the end when loop ends i have 10 different audio files. I am using the audio write command
John Hock
John Hock el 11 de Ag. de 2018
audiowrite('testing chb4-7 with no seizure.wav',scaled_c,Fs); scaled_c is the data and fs is the sampling frequency testing chb4-7 with no seizure.wav' is the title

Iniciar sesión para comentar.

Productos

Versión

R2013a

Etiquetas

Preguntada:

el 7 de Ag. de 2018

Editada:

el 12 de Ag. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by