Question regarding function inputs
Show older comments
function y=lagrange(x,pointx,pointy)
n=size(pointx,2);
L=ones(n,size(x,2));
In many places in the coding (.m) file I found codes like this (this is from the lagrange method file by "Calzino" from this website)
I understand why we type "y=f(x)" or "y=@x f(x)" but I don't understand what's the reasons we do "y=something (something1,something2,something3)"
Accepted Answer
More Answers (1)
Marco Wu
on 4 Mar 2011
0 votes
"function y=lagrange(x,pointx,pointy)"
is the standard form to CREATE a function in matlab. This time the function is called lagrange and have 3 inputs (x, pointx and pointy)
When you USE the SAME function, you will type
y=lagrange(x,pointx,pointy)
Please vote me if you think it is clear
2 Comments
buxZED
on 4 Mar 2011
Walter Roberson
on 4 Mar 2011
The function is the lines you show, the assignment to n and L.
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!