how do I write a for loop that calls a function for each output value of another function?

2 ビュー (過去 30 日間)
Mohammed
Mohammed 2016 年 9 月 5 日
回答済み: Walter Roberson 2016 年 9 月 5 日
I wrote two functions, one of them needs to contain a for loop that calls another function for each output value [M]=FirstFunction (lowValue,highValue) inside this function i need to write a for loop that loops through all outputs of the second function inside a specified range. the second function is [A,B,C]=SecondFunction(SingleValue) how do i write the for loop? i am a biginner in matlab ! Your help is a appreciated !

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 9 月 5 日
[A, B, C] = SecondFunction(SingleValue);
for K = 1 : numel(A)
this_A = A(idx);
do_something(this_A);
end

カテゴリ

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