フィルターのクリア

Using an array as an output

5 ビュー (過去 30 日間)
amateurintraining
amateurintraining 2017 年 9 月 24 日
回答済み: Gaige 2023 年 10 月 5 日
I have a function and the output must be a one-dimensional array consisting of the elements y1, y2, y3, and y4.
Do I have to make a subfunction or nested function in order to define the output?
Simply writing
output=[y1 y2 y3 y4]
does not work.
  2 件のコメント
per isakson
per isakson 2017 年 9 月 24 日
編集済み: per isakson 2017 年 9 月 24 日
"Simply writing [...] does not work". If "the elements y1, y2, y3, and y4" are scalars I cannot see why it shouldn't work.
amateurintraining
amateurintraining 2017 年 9 月 24 日
It said that the variable is undefined. Maybe this is because it is an output?

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

回答 (1 件)

Gaige
Gaige 2023 年 10 月 5 日
I would need to see all the code to be sure. Did you try seperating the elements with a coma, and was output the return falue of the function?

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by