Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc
- close all
- clear all
- a=0;
- m=10;
- b=15;
- xmin=0;
- xmax=15;
- it=1;
- for x=xmin:0.1:xmax
- if x<=a
- v(it)=1
- elseif a<=x<=m
- v(it)=(x-a)/(m-a)
- elseif x==m
- v(it)=1
- elseif m<=x<=b
- v(it)=(b-x)/(b-m)
- elseif x>=b
- v(it)=b
- end
- end
- s=linspace(xmin,xmax,(xmin+xmax)*10)
- plot(s,v,'--')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement