Subroutine functions in MatLab
25 ビュー (過去 30 日間)
古いコメントを表示
How can I make a subroutine module (similar to another programming languages) in a MatLab m-file program?
How to call it in case you no variables between the function brackets such as "function [ init ] = init( )"?
0 件のコメント
回答 (1 件)
James Tursa
2018 年 8 月 9 日
編集済み: James Tursa
2018 年 8 月 9 日
Create a file with the following name: init.m
Put your code into this file, e.g.,
function stuff = init
stuff = whatever;
end
Call this function like you would any other function:
mystuff = init;
12 件のコメント
Rajasmita Sahoo
2023 年 1 月 20 日
please kindly reply.
Walter Roberson
2023 年 1 月 20 日
Please see http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F for information on better approaches than using global
参考
カテゴリ
Help Center および File Exchange で Performance and Memory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!