How to change this function fun = @(x)x(1)*exp(-norm(x)^2) to x^2+y^2?
30 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Alex Mcaulley
on 28 May 2019
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 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!