Cell array after cell2table command in MATLAB 2020a
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi guys,
I am dealing with a large dataset recently. I want to match data in a CTD csv file (20 columns) with the metadata (14 columns) in my image analysis by the conversion of Julian days. Then save the entire worksheet (34 columns) into a new csv file. However, some columns went blank when I saved the data. I checked back on the variable found something like this:
It looks like some cell arrays were not converted into the table, they remained as cell format by cell2table command. The size of the table was around 100,000 x 34. But the same code worked well with a smaller dataset. I was able to output the result in each column by a 20,000 x 34 dataset. I loaded the CTD file by readmatrix() and the metadata in image analysis by readtable() because there are some strings in the matadata. When merging the data to one table, I converted each data into cell first, then convert the entire 43 column cell into a table, finally save the table format worksheet into csv file. I have been trapped by this for days. I would really appreciate it if anyone could help me out.
Thanks!
Huanqing
Solution:
That is because there was a coordinate with 2 numbers (an array), so that they can't convert to a table variable and became blank. After I fixed this problem, all the columns show up as expected.
댓글 수: 0
채택된 답변
Shadaab Siddiqie
2021년 3월 5일
From my understanding you do not see elements in the csv file. This might be because you are adding duration, cell, etc type into your csv. To resolve this you can convert all the elements into string or double before adding it into the file.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!