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?

 Respuesta aceptada

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 comentario

esmail chogoli
esmail chogoli el 1 de En. de 2016
Editada: esmail chogoli el 1 de En. de 2016
thank you for your answer.but when i want to write this code in matlab give me an error for mask

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Design Optimization en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by