How can I write the following function in Matlab?

please help me. i want this function to solve following optimization problem. can you help me?

 採用された回答

Walter Roberson
Walter Roberson 2016 年 1 月 1 日

0 投票

function r = rho(r,c)
r = c^2/6 .* ones(size(r));
mask = abs(r) <= c;
r(mask) = c^2/6 .* (1 - (1 - r(mask)./c).^2).^3);

1 件のコメント

esmail chogoli
esmail chogoli 2016 年 1 月 1 日
編集済み: esmail chogoli 2016 年 1 月 1 日
thank you for your answer.but when i want to write this code in matlab give me an error for mask

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Design Optimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by