Table won't export as .csv into correct folder
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Taylor Azizeh
el 27 de Oct. de 2023
Respondida: Taylor Azizeh
el 31 de Oct. de 2023
I am trying to export a big table (62413451x16) as a .csv file into a specific folder. This seems like it should be simple but it's not showing up for some reason. I am trying to run this code below:
save_table = 'G:\My Drive\directory';
table_path = fullfile(save_table, 'file.csv');
writetable(data, table_path)
Respuesta aceptada
Más respuestas (1)
Pratyush
el 27 de Oct. de 2023
Hi Taylor,
I understand that you are not able to export your CSV file to the desired folder.
The code you provided seems correct for exporting a table as a .csv file in MATLAB. However, there are a few things you can check to troubleshoot the issue:
- Make sure the "data" variable contains the table you want to export. You can verify this by displaying the table or checking its dimensions.
- Ensure that the directory "G:\My Drive\directory" exists and is accessible. Verify that you have write permissions for the specified directory.
- If there are no error messages try accessing the file from MATLAB or command prompt.
- If you have a numeric or cell array that you want to export as a CSV file, you can use the "writematrix" function. This function is generally faster than "writetable" for large arrays.
2 comentarios
Stephen23
el 28 de Oct. de 2023
"The file is exported now, but as a text file."
There is nothing stopping your from changing the file extension, if that is the problem.
Ver también
Categorías
Más información sobre Text Files en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!