How to make a function defined at discrete points?

 Respuesta aceptada

Star Strider
Star Strider el 12 de Sept. de 2016
One possibility:
xn = @(n) [(n==0) (n==1) (n==2) (n==5) (n==6)]*[1; 2; 3; 2; 2];
y = xn(2)
y =
3

Más respuestas (0)

Categorías

Más información sobre Interactions, Camera Views, and Lighting en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 12 de Sept. de 2016

Respondida:

el 12 de Sept. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by