I'm doing an exercise with fem and i have 4 function. How do I use them one after the other to get a final result at the end?

 採用された回答

Walter Roberson
Walter Roberson 2016 年 11 月 10 日

0 投票

temp1 = first_function(YourInput);
temp2 = second_function(temp1);
temp3 = third_function(temp2);
output = fourth_function(temp3);

3 件のコメント

Andrea Daloisio
Andrea Daloisio 2016 年 11 月 10 日
編集済み: Walter Roberson 2016 年 11 月 10 日
thank you walter. so i have first function "kernel" second "kernel II" third "kernel III" and fourth "kernel IV"
the script will be
temp1 = kernel;
temp2 = kernel II(temp1);
temp3 = kernel III(temp2);
output = kernel IV(temp3);
Is it right?
Walter Roberson
Walter Roberson 2016 年 11 月 10 日
If kernel() does not have any inputs, then
temp1 = kernel();
temp2 = kernelII(temp1);
temp3 = kernelIII(temp2);
output = kernelIV(temp3);
Note: I used this form with assigning to variables each time because it can generalize to functions that have multiple outputs, such as
[temp1a, temp1b] = kernel();
temp2 = kernelII(temp1a, temp1b);
In the case where there is only ever one input and one output, you can use
output = kernelIV( kernelIII( kernelII( kernel() ) ) )
Andrea Daloisio
Andrea Daloisio 2016 年 11 月 10 日
thanks a lot walter

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by