【发布时间】:2012-12-14 11:59:06
【问题描述】:
我正在尝试将数据集的第一列设置为观察名称。每个观察都是数据集“投资组合”中的一个单独股票。
我试过这个命令:
portfolio.Properties.ObsNames = portfolio.ticker
我收到了错误消息
Error using dataset/subsasgnDot (line 31)
NEWNAMES must be a nonempty string or a cell array of nonempty strings.
Error in dataset/subsasgn (line 83)
a = subsasgnDot(a,s,b);
我查看了代码,但没有看到哪里出错了。
我尝试强制转换为元胞数组,但没有成功。我使用了这段代码:
portfolio.Properties.ObsNames = dataset2cell(portfolio.ticker)
并收到此错误消息
Undefined function 'dataset2cell' for input arguments of type 'cell'.
接下来我应该尝试什么?
【问题讨论】:
-
对于你问题的第二部分,{portfolio.ticker(:)} 不会做演员吗?
-
这给了我错误消息“NEWNAMES 必须为 A 中的每个观察包含一个名称。”
标签: matlab