How can turn a matrix into a function ?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello !
My teacher asked us to interpolate a scatter graph. But now, he wants me to use the secant and the bissection method to find its roots. Unfortunately, Matlab considers YY as a variable and not a function that I could use. I don't know exactly what to do to make it work.
YY = spline(X, Y, X);
plot ( X, YY, 'r');
function y = secante(@f,x0,x1,tolerance)
Thank you so much !
댓글 수: 0
답변 (1개)
Sid Jhaveri
2017년 3월 2일
Hi Céline,
Yes, YY is a variable in MATLAB. A variable in MATLAB stores some data. Whereas, a function is a piece of code with manipulates data or gives instructions to MATLAB to do some processing. You can use YY as an input argument in a function.
I believe that your professor has asked you to use "secant" and "bisection" methods. You should be able to find functions in MATLAB that can be used for this. I would recommend you to go through the MATLAB documentation to find a function which serves your requirements.
Also, I would recommend you to take MATLAB Onramp training. It is a complimentary training given by MathWorks to learn MATLAB interactively, at your own pace. You can access this through MATLAB Academy.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!