Saving some part of a cell array
古いコメントを表示
Hello,
I have a 1x11 cell and want to save some columns of the cell (from 1st column to 8th column only) into a MAT-file.
data =
columns 1 through 4
[21350235x8 char] [21350235x6 char] [21350235x6 char] [21350235x1 int32]
columns 5 through 8
[21350235x64 char] [21350235x10 char] [21350235x1 int32] [21350235x1 int32]
columns 9 through 11
{21350235x1 cell} {21350235x1 cell} {21350235x1 cell}
Columns 9 ~ 11 consist of character strings of variable lengths containing unicode texts. If I try to save them in MAT-file, MATLAB requires to use -v7.3 switch. The saved MAT file has too large size, I want eliminate columns 9 through 11 instead.
Could you please tell me how to do it?
Many thanks!
8 件のコメント
Geoff Hayes
2015 年 2 月 22 日
Yongmin - do you want to access the first 8 columns only or save them to a file or something else? Please clarify what you intend to do with the eight columns.
Yongmin
2015 年 2 月 22 日
Geoff Hayes
2015 年 2 月 22 日
What can you tell us about each column in the cell array? Are they strings, numbers, arrays, matrices? Do they have the same data type or different? Are they of the same dimension or different? Do you want to save the data to a text file or a binary file or a mat file? Please include all relevant information.
Yongmin
2015 年 2 月 22 日
Geoff Hayes
2015 年 2 月 24 日
Try removing the 9th to 11th columns of data as
data = data{1:8};
and then save the array as before.
Yongmin
2015 年 2 月 24 日
Titus Edelhofer
2015 年 2 月 24 日
There was a typo in Geoff's comment, it should be
data = data(1:8);
instead.
Titus
Yongmin
2015 年 2 月 24 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!