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 Exchange에서 Simulink Design Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by