フィルターのクリア

Please, help me with this loop

1 回表示 (過去 30 日間)
SAMUEL AYINDE
SAMUEL AYINDE 2017 年 5 月 24 日
回答済み: Walter Roberson 2017 年 5 月 24 日
I want to achieve this:
% Refine mesh four times and run the code
model.mesh('mesh1').feature.create('ref1', 'Refine');
model.mesh('mesh1').feature.create('ref2', 'Refine');
model.mesh('mesh1').feature.create('ref3', 'Refine');
model.mesh('mesh1').feature.create('ref4', 'Refine');
model.mesh('mesh1').run('ftri1');
I am using the code below, but it is not running
% Refine mesh four times and run the code
n =4
for k = 1:n
ref{k} = ['ref', num2str(k)];
end
for k = 1:n
model.mesh('mesh1').feature.create('ref{k}', 'Refine');
end
model.mesh('mesh1').run('ftri1');
Please, what am I doing wrong? Perhaps, I cannot achieve my goal using the code below, please, help me modify it. Thank you.

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 5 月 24 日
model.mesh('mesh1').feature.create(ref{k}, 'Refine');

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by