How do I convert a CSV into a .mat file?
126 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nicholas
el 13 de Feb. de 2023
Comentada: Nicholas
el 13 de Feb. de 2023
Hi all! I'm very, very new to Matlab.
With that said, does anyone know how to convert a CSV file into a .mat file in the MATLAB environment? I've had a lot of trouble answering this question.
I attached a CSV file I'd like to convert as an example.
Thank you!
1 comentario
Stephen23
el 13 de Feb. de 2023
"I've had a lot of trouble answering this question."
Use READMATRIX and SAVE. If you don't know what options you have for file import/export, start here:
Respuesta aceptada
Dyuman Joshi
el 13 de Feb. de 2023
Since the csv only contains numeric data, use readmatrix to load the data in a variable
variablename=readmatrix('s1.csv')
and save accordingly
save('filename.mat','variablename')
Más respuestas (1)
Arif Hoq
el 13 de Feb. de 2023
loadyourfile=readtable("s1.csv");
save('yourmatfile.mat','loadyourfile')
Ver también
Categorías
Más información sobre Search Path en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!