How to save each column in E drive of computer?

1 visualización (últimos 30 días)
Faheem Ur Rehman
Faheem Ur Rehman el 15 de Abr. de 2021
Comentada: DGM el 15 de Abr. de 2021
I have data of dimension (1024x10000) in workspace i want to save each column in my computer. after saving each column it should like (1024,1).
Thank you
  4 comentarios
DGM
DGM el 15 de Abr. de 2021
What sort of files? .mat files? csv? something else?
Faheem Ur Rehman
Faheem Ur Rehman el 15 de Abr. de 2021
i need .mat file

Iniciar sesión para comentar.

Respuesta aceptada

DGM
DGM el 15 de Abr. de 2021
Consider the simple example:
A=rand(500,10); % placeholder data
for f=1:size(A,2)
outname=sprintf('output_%06d.mat',f); % zero-padded sequential filenames
outvec=A(:,f);
save(outname,'outvec');
end
You'll have to adjust the file path and name as needed
  2 comentarios
Faheem Ur Rehman
Faheem Ur Rehman el 15 de Abr. de 2021
thank you thats work
DGM
DGM el 15 de Abr. de 2021
Yes. The example array is a placeholder to demonstrate the concept. I wasn't going to create 10000 files on my computer.
Instead of having a 500x10 array, you have a 1024x10000 array. Replace A with your array.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by