How to change this function fun = @(x)x(1)*exp(-norm(x)^2) to x^2+y^2?
30 次查看(过去 30 天)
显示 更早的评论
Hi
I dont know how to change fun = @(x)x(1)*exp(-norm(x)^2) to function x^2+y^2??
Thanks for answers
0 个评论
回答(1 个)
Alex Mcaulley
2019-5-28
fun = @(x) (x(1)^2 + x(2)^2) %x(1) is x and x(2) is y
%or
fun = @(x,y) (x^2 + y^2)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!