function on separate interval
이전 댓글 표시
Hello there, I have a function f(x,t) defined on (0,1). The function is however discontinuous at x=1/2 such that we have two separate values f1(x,t) for x in (0,1/2) and f2(x,t) for x in (1/2, 1). How do I program this function with M function file that takes input x and t?. Arbitrary function can be used to explain. Thanks a lot
댓글 수: 4
Ced
2016년 3월 25일
Just use an if statement checking in what domain your input is, and evaluate accordingly.
Oluwaseun Lijoka
2016년 3월 25일
편집: Walter Roberson
2016년 3월 25일
Walter Roberson
2016년 3월 25일
Is x a scalar or a vector?
Oluwaseun Lijoka
2016년 3월 26일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!