save .csv file in given folder

60 visualizaciones (últimos 30 días)
Dion Theunissen
Dion Theunissen el 18 de Feb. de 2021
Comentada: Just Manuel el 18 de Feb. de 2021
Hi,
I want to save a .csv file which i made by myself to a given path. The way I have it now it will be saved in de path which is open in the current folder explorer.
how can i send this to a given path name. This name will vary in a loop
Ocsvname = 'vessel'+string(i)+'.csv';
data_reinterp = interp1(sample_dist,DataText,dist_interp,'pchip');
%save as csv file
csvwrite(Ocsvname, data_reinterp);

Respuesta aceptada

Just Manuel
Just Manuel el 18 de Feb. de 2021
Just provide an absolute path instead of a relative one. Such as
csvwrite('c:\temp\data.csv',ones(2,5));
You can also combine path and name using fullfile
>> fullfile('c:\temp','data.csv')
ans =
'c:\temp\data.csv'
Cheers
Manuel
  2 comentarios
Dion Theunissen
Dion Theunissen el 18 de Feb. de 2021
Thanks Manuel
Just Manuel
Just Manuel el 18 de Feb. de 2021
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by