Cell array after cell2table command in MATLAB 2020a
1 回表示 (過去 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!