how can i pass a vector to a function?
7 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Birdman
2018 年 2 月 8 日
function z=f(x,y)
z=x.^2+y.^2;
end
From command line, type
x=[1;2];y=[3;4]
z=f(x,y)
and the result would be
[10;20]
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surfaces, Volumes, and Polygons についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!