What's "randval(a,b)"?
Mostrar comentarios más antiguos
Hi everybody,
What doe "randval(a,b)" do? Is it a function? i can not find it in help!
Looking forward to hearing from you all!
Best,
Respuesta aceptada
Más respuestas (2)
Wayne King
el 18 de Sept. de 2012
Editada: Wayne King
el 18 de Sept. de 2012
It is not a MathWorks' function. So apparently you have downloaded, or somebody downloaded, or has written a function randval(). If you enter
>>which randval
You'll see where that function lives on your computer.
If you enter
>>type randval
or
>>edit randval
You can see the code. From the function name perhaps it is just picking one of the inputs (a or b) at random
Something like
a = 2;
b = 3;
rval = rand(1);
if (rval <0.5)
a
elseif (rval >=0.5)
b
end
Walter Roberson
el 18 de Sept. de 2012
0 votos
I am only finding reference to it as a variable. What context did you find it in?
1 comentario
Respaco
el 18 de Sept. de 2012
Categorías
Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!