How do I convert a CSV into a .mat file?
131 次查看(过去 30 天)
显示 更早的评论
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 个评论
Stephen23
2023-2-13
"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:
采纳的回答
Dyuman Joshi
2023-2-13
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')
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Search Path 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!