Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alpha=10;
- beta = 25;
- gamma = 40;
- for i=1:10
- x(i) = i*5
- if x(i)<=alpha
- y(i)=0;
- elseif x(i)<=beta
- y(i) = (x(i)-alpha)/(beta-alpha)
- elseif x(i) <=gamma
- y(i)=(gamma-x(i))/(gamma-beta);
- else
- y(i) = 0;
- end
- end
- plot(x,y)
Add Comment
Please, Sign In to add comment