How to change this function fun = @(x)x(1)*exp(-norm(x)^2) to x^2+y^2?

30 vues (au cours des 30 derniers jours)
Jakub Reczek
Jakub Reczek le 28 Mai 2019
Hi
I dont know how to change fun = @(x)x(1)*exp(-norm(x)^2) to function x^2+y^2??
Thanks for answers

Réponses (1)

Alex Mcaulley
Alex Mcaulley le 28 Mai 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)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by