X = [1 2 3 4 5 6 7 8]; Y = [0 1 0 1 0 1 0 1]; [P,R,S] = lagrangepoly(X,Y);
xx = 0.5 : 0.01 : 8.5; plot(xx,polyval(P,xx),X,Y,'or',R,S,'.b',xx,spline(X,Y,xx),'--g') grid axis([0.5 8.5 -5 5])
Why do I get an ERROR? Undefined function or variable 'lagrangepoly'

 채택된 답변

Star Strider
Star Strider 2017년 10월 27일

1 개 추천

You first need to download it from the File Exchange at Lagrange Interpolator Polynomial (link) and then install it on your MATLAB search path.

댓글 수: 2

Jack Steines
Jack Steines 2018년 4월 26일
How do you install something on the MATLAB search path?
Star Strider
Star Strider 2018년 4월 26일
Copy the function or script file to any directory on your user path.
See:
and

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

질문:

2017년 10월 27일

댓글:

2018년 4월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by