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

9 vues (au cours des 30 derniers jours)
Gautam
Gautam le 19 Juin 2014
Réponse apportée : SRI le 19 Juin 2014
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.

Réponse acceptée

SRI
SRI le 19 Juin 2014
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

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by