How to turn an array of doubles to cell array

20 ビュー (過去 30 日間)
JFz
JFz 2017 年 1 月 26 日
コメント済み: JFz 2017 年 1 月 27 日
How to turn an array of doubles to cell array? I need to use an array of doubles (they are actually integers) and assign this new array into a table variable names, but I keep getting an error: "The VariableNames property must be a cell array, with each element containing one nonempty string."
Thanks,
jennifer
  2 件のコメント
Guillaume
Guillaume 2017 年 1 月 26 日
And why on earth do you think that changing an array of numbers into a cell array is going to help with the error that clearly says "the ... must be a cell array ... containing ... string"?
Note that the VariableNames of the table is the name of the columns which you can use to access a particular column (e.g. mytable.somevariablename). It's never going to contain number. So your "I need to assign an array of number into a table variable names" does not make any sense.
Please explain what you're trying to do , showing an example of inputs and corresponding desired output.
JFz
JFz 2017 年 1 月 27 日
Thanks. I solved the problem.

サインインしてコメントする。

採用された回答

the cyclist
the cyclist 2017 年 1 月 26 日
編集済み: the cyclist 2017 年 1 月 26 日
You can use the num2cell command to do what you ask.
It may still balk, because the cell contents are numeric. In that case, you could use num2str or sprintf to convert the numeric arrays.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by