How to define a constat in function handle?

2 visualizaciones (últimos 30 días)
jomson joy
jomson joy el 15 de Sept. de 2021
Comentada: jomson joy el 15 de Sept. de 2021
Hello,
Suppose I have to define a polynomial with function hadle of f(x,y) = ax^2+by+c with a, b, c as constants. So I can do the other mathematical operations likr integration, differentiation with this function handle.
Please note that I dont want to define the constants as numbers like f = @(x,y) 3x^2+4y+5.
Could someone please help me?
Thanks and regards

Respuesta aceptada

Matt J
Matt J el 15 de Sept. de 2021
Editada: Matt J el 15 de Sept. de 2021
You mean like this?
[a,b,c]=deal(3,4,5);
f = @(x,y)a*x.^2+b*y+c
f = function_handle with value:
@(x,y)a*x.^2+b*y+c
Or like this?
syms x y a b c f(x,y)
f(x,y)=a*x.^2+b*y+c
f(x, y) = 
  1 comentario
jomson joy
jomson joy el 15 de Sept. de 2021
The symbolic one. That was the command I was looking for.
Thanks you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Polynomials en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by