From: Steven Lord on

"alfann" <alfann.net(a)hotmail.com> wrote in message
news:117054771.11249.1271253889544.JavaMail.root(a)gallium.mathforum.org...
> Sorry to disturb you
> but
> all the helps that I got them are noe closed to my question.
> I have two terminals:
> the maximum value is 1.81
> the minimum value is 1.11
> X = one value between 1.81 and 1.11
>
> each time I write X, I want to show different value btween 1.81 and 1.11
>
> How can I do it?

As I said, look at the first example in HELP RAND. It does EXACTLY what you
described.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: alfann on
This is the first example:

Example 1
Make a random choice between two equally probable alternatives:

if rand < .5
'heads'
else
'tails'
end

It does not talk about what I want.
Could you please check and help me...
From: Steven Lord on

"alfann" <alfann.net(a)hotmail.com> wrote in message
news:1199768295.11665.1271257175000.JavaMail.root(a)gallium.mathforum.org...
> This is the first example:
>
> Example 1
> Make a random choice between two equally probable alternatives:
>
> if rand < .5
> 'heads'
> else
> 'tails'
> end
>
> It does not talk about what I want.

Ah, you're probably using an older version of MATLAB from before the first
example was changed. Look at the first example on this page.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/rand.html?BB=1

Note that if you are in fact using an older version of MATLAB, one without
the RandStream class, the second and third portions of that example will not
run ... but the first code line is what you want.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ