フィルターのクリア

I am only getting one output when I have 2 defined and 2 inputs?

4 ビュー (過去 30 日間)
Zachary Giovanelli
Zachary Giovanelli 2018 年 6 月 1 日
コメント済み: Stephen23 2018 年 6 月 2 日
I have defined 2 outputs and put in 2 inputs but I am only getting one output. I don't know the issue? I have read other documentation but it does not seem to help me out here.
function [Height, Range] = Projectile2(InitialV,Angle)
% Detailed explanation goes here
Vyinitial = (InitialV * sin(Angle));
Tfinal = (2*(InitialV * sin(Angle))/9.8);
Time = Tfinal/2;
Height = Vyinitial * Time - (.5 * 9.8 * Time^2);
Vxinitial = (InitialV * cos(Angle));
Range = Vxinitial * Tfinal;
end

採用された回答

Roozbeh Yousefnejad
Roozbeh Yousefnejad 2018 年 6 月 1 日
I got 2 output from your function. use it like this first define InitialV,Angle, then [a,b]=Projectile2(InitialV,Angle)
you will get a and b which are your outputs
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 6 月 1 日
In particular you need to request two output variables from the function, the way that Roozbeh shows here.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by