How can I have multiple arrays as an input for my function?

4 ビュー (過去 30 日間)
James
James 2019 年 9 月 6 日
編集済み: James 2019 年 9 月 9 日
If P and Q was a 1x3 array, how could I make that as an input in my function as the square brackets do not work. Thanks
  1 件のコメント
Stephen23
Stephen23 2019 年 9 月 6 日
編集済み: Stephen23 2019 年 9 月 6 日
@James: pay attention to the syntax warnings that the MATLAB editor is showing you:
Those wiggly lines are not decorations. They show you syntax errors and ways that you should improve your code.
Reading the documentation is the best way to know how to write MATLAB code:

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2019 年 9 月 6 日
function SquaredDistance = PixelDistance(P, Q)
P1 = P(1); P2 = P(2); P3 = P(3);
Q1 = Q(1); Q2 = Q(2); Q3 = Q(3);
now calculate the distance
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by