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 Center および File ExchangeLoops 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