How to find a minimum value that calculated from a formulation?

1 回表示 (過去 30 日間)
Le Dung
Le Dung 2017 年 2 月 1 日
コメント済み: Le Dung 2017 年 2 月 1 日
Hi, Now, i have some parameters that range into a region. And i have a formulation that calculated form these parameters. (below code) And i want to find minimum value of the formulation that has to satisfy a condition. And i want to display that minimum value and coresponding values of parameters above. Help me, plesea. Thank you so much. My code:
x=(50:100);
y=(50:100);
z=(15:50);
Mu=4000;
Mrmin=0;
for i=1:51
for j=1:51
for k=1:36
Mr = x(i)*y(j)*z(k);
if Mr >= Mu
Mrmin = Mr;
end
end
end
end

採用された回答

Torsten
Torsten 2017 年 2 月 1 日
x=(50:100);
y=(50:100);
z=(15:50);
Mrmin=Inf;
Mu=4000;
imin=1;
jmin=1;
kmin=1;
for i=1:51
for j=1:51
for k=1:36
Mr = x(i)*y(j)*z(k);
if (Mr <= Mrmin) && (Mr >= Mu)
Mrmin = Mr;
imin = i;
jmin = j;
kmin = k;
end
end
end
end
Best wishes
Torsten.

その他の回答 (1 件)

Niels
Niels 2017 年 2 月 1 日
編集済み: Niels 2017 年 2 月 1 日
x=(50:100);
y=(50:100);
z=(15:50);
Mrmin=Inf;
for i=1:51
for j=1:51
for k=1:36
Mr = x(i)*y(j)*z(k);
if Mr <= Mrmin && Mr>4000
Mrmin = Mr;
end
end
end
end

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by