function on separate interval
Ältere Kommentare anzeigen
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 Kommentare
Ced
am 25 Mär. 2016
Just use an if statement checking in what domain your input is, and evaluate accordingly.
Oluwaseun Lijoka
am 25 Mär. 2016
Bearbeitet: Walter Roberson
am 25 Mär. 2016
Walter Roberson
am 25 Mär. 2016
Is x a scalar or a vector?
Oluwaseun Lijoka
am 26 Mär. 2016
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!