作者s4300026 (s4300026)
看板MATLAB
标题[讨论] struct a.b([1:5]).c=1; 为什麽错?
时间Mon Jun 29 17:34:40 2015
如题
我想要做到
a.b(1).c = 1
a.b(2).c = 1
a.b(3).c = 1
a.b(4).c = 1
a.b(5).c = 1
就很顺手的打
a.b([1:5]).c=1;
然後就得到
Insufficient outputs from right hand side to
satisfy comma separated list expansion on left hand
side. Missing [] are the most likely cause.
该怎麽改成正确呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.123.121.126
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1435570483.A.808.html
1F:→ celestialgod: field不能这样操作 06/29 17:36
2F:→ s4300026: 所以此题无解 只能用for了? 06/29 17:41
3F:→ celestialgod: 用cell转比较快 06/29 17:47
4F:→ celestialgod: 看下面回文 06/29 17:47