【发布时间】:2015-05-16 08:17:16
【问题描述】:
在 Matlab 中,我试图预先分配一个全局结构数组。 1. 前置关键字 global 会出错。 2. 尝试预分配对象时出错
例如- 下标赋值维度不匹配。
IronCondor 中的错误(第 41 行) 选项链(MaxOptions+1) = s; % 确保兼容性
MaxOptions = 3000;
OptionsChain = struct('symbol', {}, 'expiration', {}, 'strike_price', {}, 'bid', {}, 'ask', {}, 'last', {}, 'volume', {}, 'last_time', {});
if ~isempty(OptionsChain) && isstruct(OptionsChain)
OptionsChain(MaxOptions+1) = s; % make sure compatibility
end
【问题讨论】:
-
嗨!我的回答对你有帮助吗?
标签: matlab