フィルターのクリア

How can I calculate the average deviation for two values that are in two separate variables files?

1 回表示 (過去 30 日間)
I want to calculate the average deviation flow rate per day. The data value is in one variable and the value in the model is in another variable

採用された回答

Pranavkumar Mallela
Pranavkumar Mallela 2023 年 7 月 12 日
編集済み: Pranavkumar Mallela 2023 年 7 月 12 日
Hi Francisca,
As per my understanding you want to access a variable in one file that is defined in another. To do this, you can output your variable in one file. Then, access it from the second file by calling a function. To elaborate:
In file 1, where the variable is defined, use the following code:
function myVar = data()
myVar = 100;
end
In file 2, where you want to use the variable, use the following code:
function myFunc()
myVarFromFile1 = data(); % myVarFromFile1 takes the value defined in file 1
end
Hope this helps! Thanks!
  4 件のコメント
Francisca
Francisca 2023 年 7 月 13 日
Thanks for the information and all the help.
It worked!
Pranavkumar Mallela
Pranavkumar Mallela 2023 年 7 月 13 日
That's great to hear. If the answer was helpful, please do consider accepting it. Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by