Last active
May 13, 2019 13:47
-
-
Save argaghulamahmad/46df191b8e36c86cadd2137f09241bef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pathcalculator(n) | |
| plot([-1 1],[0,0],'k',[0 0],[-1 1],'k');hold on | |
| t=0:.02:1; | |
| xdata = zeros(1,n); | |
| ydata = zeros(1,n); | |
| for i=1:n | |
| [x,y] = ginput(1) % get three mouse clicks | |
| plot(x, y, 'bo'); | |
| xdata(i) = x; | |
| ydata(i) = y; | |
| endfor | |
| xf = [-1:0.05:1]; | |
| xp = [-1:1]; | |
| spl = interp1 (xdata, ydata, xf, "spline"); | |
| plot (xf,spl,"m"); | |
| legend ("spline"); | |
| endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment