Hello,
I am trying to plot a function of a function, f(x(t)) with piecewise limits, however I keep getting an error that "Subscript indices must either be real positive integers or logicals."
Im wondeirng if I need to adjust my limits im using in my piecewise function so they are in terms of t or if I can leave it in the current form and am missing something else.
t =[0:0.1:2*pi];
x = 2*sin(t);
f_1 = piecewise(x<-1, 1.5*x+1.5, 0, -1<x<1, 1.5*x(t)-1.5, x>1);
plot (f_1, t);
Thank you
1 Comment
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/599959-plotting-a-function-of-a-function-with-piecewise-limits#comment_1025209
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/599959-plotting-a-function-of-a-function-with-piecewise-limits#comment_1025209
Sign in to comment.