can not update value

1 次查看(过去 30 天)
vaya putra
vaya putra 2019-5-27
回答: vaya putra 2019-5-28
hi Matlab
i have done many time to used iteration for
i want to update value in nwc and hWW put it value from fm.WellModel
but always got errors message
nw = fm.getNumberOfWells(); %2
nwc=nan(nw,1);
hWW=nan(nw,1);
for i = 1:nw
wm = fm.WellModels{i}; %fm.WellModel consist of 2x1 cell array
W = wm.W;
wc = W.cells;
nwc(i)=numel(W(i).cells);
hWW(i)=W(i).hW;
Solving timestep 01/50: -> 2 Days
Index exceeds matrix dimensions.
  5 个评论
vaya putra
vaya putra 2019-5-28
thank all, i already solved..
Raghunandan V
Raghunandan V 2019-5-28
Please post the answer. It will help others

请先登录,再进行评论。

回答(1 个)

vaya putra
vaya putra 2019-5-28
by modify this script and its work
[nwc,hWW] =deal(nan(nw,1));
for i = 1:nw
wm = fm.WellModels{i};
W = wm.W;
wc = W.cells;
nwc(i)=W.cells;

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by