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

回答(1 个)

Alex Mcaulley
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)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by