I am trying to save some data named (cn,y,z) into the directory with folder, vfolder. I expect the file (cn,y,z) to be contained in Pzz5X10. I keep getting errors anytime I run the code below. Any help will be appreciated.
Thanks.
zz = '10';
f = '5';
vfolder = pwd;
save([vFolder,'\' 'Pzz'+f+'X'+zz.mat'],'cn','y','z');

 Respuesta aceptada

Stephen23
Stephen23 el 11 de Jun. de 2023

0 votos

save([vFolder,'\' 'Pzz'+f+'X'+zz.mat'],'cn','y','z');
% ^^^^^^^ invalid syntax
Better:
fnm = sprintf('Pzz%dX%d.mat',5,10);
save(fullfile(vFolder,fnm),'cn','y','z')

1 comentario

Kofi Agyemang Amankwah
Kofi Agyemang Amankwah el 11 de Jun. de 2023
thanks. please, can you resolve the issue by retaining the format i used?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre File Operations en Centro de ayuda 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