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!