フィルターのクリア

how to call values of one program into another program

2 ビュー (過去 30 日間)
anu
anu 2014 年 1 月 8 日
編集済み: ES 2014 年 1 月 8 日
suppose i have 2 programs.i want to call output of one program into my another program..how to do that

回答 (1 件)

ES
ES 2014 年 1 月 8 日
編集済み: ES 2014 年 1 月 8 日
Do you need this?
file/program 1: name it as calling_function.m
function calling_function()
n=45;
sqre_out=called_function(n)
if sqre_out > 10
...
...
end
file/program 2: name it as called_function.m
function out_no=called_function(in_no)
out_no=in_no*in_no;
  2 件のコメント
anu
anu 2014 年 1 月 8 日
did not get this...would u please explain it again?
ES
ES 2014 年 1 月 8 日
1. have an m file by name calling_function.m
2. Define the function calling_function() in that file
3. have another m file by name called_function.m
4. Define the function called_function(in_no) in that file
5. You can call called_function(in_no) from calling_function.m**
**better both the files(programs) be in the same directory. Or atleast add the path of the called file to matlab path by using addpath command. Otherwise MATLAB will not know where to look for the called file/program..

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

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by