Convert 1*1 struct file into a csv file
조회 수: 22(최근 30일)
표시 이전 댓글
Battery Fan 2021년 4월 5일
댓글: Battery Fan 2021년 4월 8일
I am new to Matlab. I want to convert the .mat file info a csv file with several columns, so that I can read into dataframe by Python.
It doesn't work with csvwrite command. Can anyone teach me how to do this? Thank you very much! I've attached the .mat file.
댓글 수: 2
Anmol Dhiman 2021년 4월 7일
The structure that you shared is a nested one. Also you haven't specified the fieldnames that you wish to have in csv file. As the structure is nested , I suggest the best way is to write code for accessing structure elements. For that you can refer to this link.
The best way if the structure is not nested is to convert struct to table and then use writetable.
Hope it helps
댓글 수: 1
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!