what happens if output and input parameters are given same name?

7 ビュー (過去 30 日間)
Gautam
Gautam 2014 年 6 月 19 日
回答済み: SRI 2014 年 6 月 19 日
Can input and output parameters of a function share same name? Example:
function a = functionName(a , b)
% code
end
What sort of conflicts would occur in such case? Please care to explain.
Thanks.

採用された回答

SRI
SRI 2014 年 6 月 19 日
Nothing will happen only the values of the variable will be changed
inputVal = 10;
inputVal = rand(inputVal)
now the value of the 10 will be replace by 10 * 10 matrix value

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by