Create variable in workspace

8 次查看(过去 30 天)
I am beginner in Matlab. I want to create variable and its value in matlab workspace through matlab script. I will call that function present in the script with parameters name and value. I want this name variable to be created in matlab workspace with value assigned to it. Parameters will be string and double array. Any help would be highly appreciated. Thanks.

采纳的回答

Paulo Silva
Paulo Silva 2011-7-8
function MakeMyVar(VarName,VarValue)
assignin('base',VarName,VarValue)
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by