MATLAB: How to pass arguments from mfile to another function

arguments passing

function [xposition yposition altitude]=position(xpos,ypos,alt,velx,vely,velz,delt)
for this function i need to pass the input arguments from another mfile how?

Best Answer

Don't keep data in .m file......keep them in a text file, where you can use importdata / load to load the data into workspace.
If you have them in .m file....give the data a variable name..and run the file once....the variables with data will be loaded into workspace.
Or, if you have data in .m file, give them variables names as input to the function, and copy the calling function:
[xposition yposition altitude]=position(xpos,ypos,alt,velx,vely,velz,delt) ;
Under the data and run the m file.
I suggest you to keep the data in text file and use load.