Clear Filters
Clear Filters

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

1 view (last 30 days)
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

Accepted Answer

Pranavkumar Mallela
Pranavkumar Mallela on 12 Jul 2023
Edited: Pranavkumar Mallela on 12 Jul 2023
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 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Large Files and Big Data in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!