Does a local function variable matter?
显示 更早的评论
When I am creating a function, does the variable I used to define it matter? When I call it in a script, I use it as the file name I saved it as. For example:
function E1=E_Voight(Vr,Em,Er)
E1=Er*Vr+Em*(1-Vr);
end
This is my function, I refer to it by its file save name (also E_Voight), but could I redefine this entire function using only x, y, z and change the file name to "Potato" and refer to it in a script as "Potato(1,2,3)" and the variables x,y,z used to define the function would not interfere with a variable that I had named x in my script?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Historical Contests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!