How to pass arguments from mfile to another function?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
DhanaLakshmiR
el 20 de Feb. de 2018
Editada: DhanaLakshmiR
el 20 de Feb. de 2018
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?
2 comentarios
Guillaume
el 20 de Feb. de 2018
Can you clarify what problem you're having? The whole points of functions (m files) is that you can pass inputs and outputs between them
Respuesta aceptada
KSSV
el 20 de Feb. de 2018
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.
3 comentarios
KSSV
el 20 de Feb. de 2018
If you have lot of for loops..you need to save your data at every iteration into a matrix....so that every value is saved. Show, us your code to get precise help.
DhanaLakshmiR
el 20 de Feb. de 2018
Editada: DhanaLakshmiR
el 20 de Feb. de 2018
Más respuestas (0)
Ver también
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!