How do I save a .mat file and .py file automatically with a 'variable's' value as filename using MATLAB?

1 visualización (últimos 30 días)
Eg: If I have a 'gradient'=20 and 'number' = 10. How to save a .mat file and .py file with a filename 20_10.

Respuesta aceptada

Stephen23
Stephen23 el 30 de Ag. de 2018
G = 20;
N = 10;
F = sprintf('%d_%d.mat',G,N);
save(F,...)

Más respuestas (1)

ahmed nebli
ahmed nebli el 30 de Ag. de 2018
you can use: save('filename.mat','X'); %where filename is the name of file and X is the variable u need to save & same for the .py file

Categorías

Más información sobre Workspace Variables and MAT-Files 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