saving in different folders

Hi
This is a statement in a for loop
[f_estimate(i), freqconf(i), z_estimate(i), dampconf(i)]
How do I save each of the variables in different folders?

 Respuesta aceptada

Angelo Yeo
Angelo Yeo el 19 de Jun. de 2023

0 votos

save(fullfile(basepath, 'folder1', 'f_estimate.mat'), 'f_estimate')
save(fullfile(basepath, 'folder2', 'freqconf.mat'), 'freqconf')
% etc ...

Más respuestas (1)

Ayush Kashyap
Ayush Kashyap el 19 de Jun. de 2023

0 votos

Hi Indrani,
As per my knowledge, you can utilize the "save" and "fullfile" functions provided by matlab inside your for loop as follows:
save(fullfile(<folder path>, ['f_estimate_' num2str(i) '.mat']), 'f_estimate', '-v7.3');
You can also refer to this documentation for more details: Matlab Save Function

Categorías

Más información sobre File Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 19 de Jun. de 2023

Respondida:

el 19 de Jun. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by