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?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 1 Jan. 2016
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 Kommentar

esmail chogoli
esmail chogoli am 1 Jan. 2016
Bearbeitet: esmail chogoli am 1 Jan. 2016
thank you for your answer.but when i want to write this code in matlab give me an error for mask

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Design Optimization finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by