Function variable output name to be the same as input variable name + "_pos".mat

Hello,
I have a function to do stuff, the input of the function is a matrix array with name X, I call this function several times using different inputs and I want to save the result in a mat file where the variable name will be the same as the input name variable and the .mat name the same name as the input name + "_pos".
function [position]= position_min(X)
function code blablabla
position = some matrix result
save ('Posicion_min', 'position')*
end
Where X would be Mx and then My and so on, I call it like this
position_min(MxTB_min_etm)
This saves variable position under Posicion_min.mat. I want to save variable position change the name to "MxTB_min_etm _pos" and save as MxTB_min_etm_pos.mat

Réponses (1)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by