daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. clc
  2. close all
  3. clear all
  4. a=0;
  5. m=10;
  6. b=15;
  7. xmin=0;
  8. xmax=15;
  9.  
  10. it=1;
  11. for x=xmin:0.1:xmax
  12.     if x<=a
  13.         v(it)=1
  14.     elseif a<=x<=m
  15.         v(it)=(x-a)/(m-a)
  16.     elseif x==m
  17.         v(it)=1
  18.     elseif m<=x<=b
  19.         v(it)=(b-x)/(b-m)
  20.     elseif x>=b
  21.         v(it)=b
  22.     end
  23. end
  24. s=linspace(xmin,xmax,(xmin+xmax)*10)
  25. plot(s,v,'--')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top