Question regarding function inputs
古いコメントを表示
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)"
採用された回答
その他の回答 (1 件)
Marco Wu
2011 年 3 月 4 日
0 投票
"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 件のコメント
buxZED
2011 年 3 月 4 日
Walter Roberson
2011 年 3 月 4 日
The function is the lines you show, the assignment to n and L.
カテゴリ
ヘルプ センター および File Exchange で Subplots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!