Respuesta aceptada

Mischa Kim
Mischa Kim el 23 de Mzo. de 2015
Editada: Mischa Kim el 23 de Mzo. de 2015

0 votos

Victor, does this help?
fh = @(x,y) x.*y.^2;
fh(3,2)
ans =
12
The example above shows a function handle for an anonymous function.
What exactly are you trying to do?

3 comentarios

Victor Seaw
Victor Seaw el 23 de Mzo. de 2015
Editada: per isakson el 23 de Mzo. de 2015
im trying to know how to apply @ in my working oh so meaning fh = @(x,y) x.*y.^2; where x.*y.^2 has to be in the same row with fh? if i used it in this way:
fh=@(x,y)
|x.*y.^2|
it wont work?
Star Strider
Star Strider el 23 de Mzo. de 2015
Editada: Star Strider el 23 de Mzo. de 2015
They generally have to be on the same line. However, you can use the ellipsis (...) as a continuation to the next line. There cannot be any blank lines after lines ending in ....
See the documentation for Special Characters for details. (It’s about half-way down the page.)
Victor Seaw
Victor Seaw el 24 de Mzo. de 2015
Thx

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Elementary Math en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Mzo. de 2015

Comentada:

el 24 de Mzo. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by