MATLAB: I have been assigned homework that ask me to make a script that calls a function. The function is a separate file from the script. I would like to know how to do this.

functionhomeworkscript

"Your script, should call your MoveAve function"

Best Answer

E.g., in your script file, you should have a line that looks something like this:
y = MoveAve(x); % x is the input and y is the output
Or if your function has multiple inputs and outputs, then maybe this:
[y1,y2] = MoveAve(x1,x2,x3); % x1,x2,x3 are the inputs and y1,y2 are the outputs
The input and output variable names are names that you get to choose for your variables (they don't have to be x1,x2,x3,y1,y2).