How to convert a .mat vector into a .csv file?

5 Ansichten (letzte 30 Tage)
Hamid Rajabi
Hamid Rajabi am 19 Jul. 2021
Kommentiert: Image Analyst am 19 Jul. 2021
I'm going to convert a .mat vector to a .csv one.
Thanks!
  4 Kommentare
Mudit Chaturvedi
Mudit Chaturvedi am 19 Jul. 2021
Hello Hamid!
I understand you are trying to convert a .mat vector to a .csv one.
You can do that by using the csvwrite function.
1. Load the data from the .mat file
FileData = load('YourFileNameGoesHere.mat');
2. Write to the target csv file
csvwrite('TargetFileNameGoesHere.csv',FileData.VectorName);
Image Analyst
Image Analyst am 19 Jul. 2021
@Mudit Chaturvedi, please put your answer down below in the Answers section (where you can get credit for it in reputation points) rather than up here in the comments section that is used to ask the poster for clarification and additional information or data.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 19 Jul. 2021
To load the matfile data into MATLAB use load. To write that variable into csv file use writetable. Read about both the functions.

Weitere Antworten (0)

Kategorien

Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by