What's "randval(a,b)"?

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,

 채택된 답변

the cyclist
the cyclist 2012년 9월 18일

0 개 추천

I don't believe there is a MATLAB function with that name. Is it presumably a user-written function. Look for a file called "randval.m". You can also type
>> which randval
to find the function, if it is in the path.

추가 답변 (2개)

Wayne King
Wayne King 2012년 9월 18일
편집: Wayne King 2012년 9월 18일

0 개 추천

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
Walter Roberson 2012년 9월 18일

0 개 추천

I am only finding reference to it as a variable. What context did you find it in?

댓글 수: 1

Respaco
Respaco 2012년 9월 18일
In a Matlab program. something like randval(number1,number2)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2012년 9월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by