How to make a function defined at discrete points?

 채택된 답변

Star Strider
Star Strider 2016년 9월 12일
One possibility:
xn = @(n) [(n==0) (n==1) (n==2) (n==5) (n==6)]*[1; 2; 3; 2; 2];
y = xn(2)
y =
3

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Interactions, Camera Views, and Lighting에 대해 자세히 알아보기

질문:

2016년 9월 12일

답변:

2016년 9월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by