This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Matlab Fib code

By: a guest on Oct 17th, 2012  |  syntax: None  |  size: 0.40 KB  |  views: 69  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. load C:\Users\123\fib.dat
  2. plot(fib(:,1), fib(:,2), 'o')
  3.  
  4. x = fib(:,1);
  5. y = fib(:,2);
  6. %fit = polyfit(x, log(y), 1)
  7. xlabel('Fibonacci Element Number [th]')
  8. ylabel('Time [ms]')
  9. title('Calculation of N-th fibonacci element')
  10. %semilogy(x, y, 'o', x, exp(fit(2)).*exp(fit(1)*x))
  11.  
  12. %x = (0: 0.1: 5)';
  13. %y = erf(x);
  14. p=polyfit(x, y, 6);
  15. f = polyval(p,x);
  16. plot(x, y,'o',x,f,'-')
  17. axis([0  50  0  7000])
clone this paste RAW Paste Data