how can i merge different codes in the main function?

1 回表示 (過去 30 日間)
Anu  Sri
Anu Sri 2018 年 8 月 6 日
コメント済み: Anu Sri 2018 年 8 月 6 日
i am performing quadtree decomposition which required the use of different functions.i have separate code for all the required tasks.I need to merge the different functions in the main fuction so that i can have only one code instead of many separate codes.Any thoughts on how i can perform it?

採用された回答

Stephan
Stephan 2018 年 8 月 6 日
編集済み: Stephan 2018 年 8 月 6 日
Hi,
you can insert as many functions as needed at the end (behind the code section) of your main script:
some code in the main script;
defining some values in main script;
calculate something;
call function_1();
do some stuff;
do more stuff;
call function_2();
do as much stuff as posible;
call function_3();
plot result;
write something to somewhere;
function some_stuff = function_1(x,y)
...
end
function some_more_stuff = function_2(z)
...
end
function final_stuff = function_3(x,y,z)
...
end
That way you could insert all code from your seperate functions into your main script and run it in one script file. Thats what you wanted to do?
Best regards
Stephan
  3 件のコメント
Stephan
Stephan 2018 年 8 月 6 日
In that case matlab gives you an error message - it wants the functions at the end of the script. Since it is a copy & paste action i recommend to try this - i learned i that way ;-)
Anu  Sri
Anu Sri 2018 年 8 月 6 日
okay thankyou sir,i will follow it that way.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by