**Random number between -1 and 1**How do I assign a uniform random number between -1 and 1?
On Dec 4, 2:19=A0pm, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> How do I assign a uniform random number between -1 and 1?
randomNumber =3D 2 * rand(1,1) - 1
"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <hfbnb8$5sk$1@fred.mathworks.com>...
> How do I assign a uniform random number between -1 and 1?
2*rand-1
On Dec 4, 1:19=A0pm, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> How do I assign a uniform random number between -1 and 1?
If you have the Stats Toolbox, unif...

**random numbers between -1,1**Hi, how do I create an array of random numbers (not normally
distributed) between -1 and +1?
Thanks!
Andrew.
Andrew Ridge wrote:
>
>
> Hi, how do I create an array of random numbers (not normally
> distributed) between -1 and +1?
>
X = rand(nrows,ncols).*2-1;
Temu
Temu Gautama wrote:
>
>
> Andrew Ridge wrote:
>>
>>
>> Hi, how do I create an array of random numbers (not normally
>> distributed) between -1 and +1?
>>
>
> X = rand(nrows,ncols).*2-1;
>
> Temu
Great, thanks very much!
...

**Random number between -1 and 1??**I have a number X that I randomly would like to increase or decrease with a
number.
I know that I can use Math.random() but that only generates a positive
number. How do I get a random number that can be either negative or
positive?
JS
n = random() * 2 - 1;
"ms" <dsf@as.com> wrote in message
news:L3Dyd.77016$Vf.3634421@news000.worldonline.dk...
>I have a number X that I randomly would like to increase or decrease with a
> number.
>
> I know that I can use Math.random() but that only generates a positive
> number. How do I get a random number that can be ei...

**LaTex equation numbering like 2.1, 2.2, also 2.0.1, 2.0,2, 2.1.1, etc**David Roach wrote:
> Is there a simple command to have latex number
> the equations by the section numbers automatically.
>
> David
From the LaTeX Companion (what a wonderful book!)
%%%%%%%%%%%%%%%%%%%%%%
% number equations within sections
% In preamble
\makeatletter
\@addtoreset{equation}{section}
\makeatother
\renewcommand{\theequation}{\thesection.\arabic{equation}}
%%%%%%%%%%%%%%%%%%%%%%
Numbers within sections...I use this all the time in articles. Even
works with
*******************
*******************
Brilliant. And then I got numbering within subsections
by repe...

**2 counters, show numbering 1.2., print only 1. instead of 1.0.?**I've set up the counters & co, but how can it actually be done that
the trailing zeros get omitted (also with 3 counters)?
(somehow failed with ifthen package and just ran away from plain
TeX..)
K?rlis Repsons <karlis.repsons@gmail.com> wrote:
> I've set up the counters & co, but how can it actually be done that
> the trailing zeros get omitted (also with 3 counters)?
> (somehow failed with ifthen package and just ran away from plain
> TeX..)
Replace "A" and "B" with the counter names:
\renewcommand*{\theB}{%
\arabic{A}%
\ifnum\valu...

**How to generate vector of random numbers in any interval (e.g. [-1 1]) that sums to 1)**Hello,
I'd like to generate a vector of random numbers,which take values in any interval (e.g. [-1 1]),and this vector sums to 1...
Thanx in advance...
Vassilis...
Just renormalise:
y = rand(1,N);
S = sum(y);
y = y/S; % renormalisation
"Vassilios Vassiliadis" <v.vassiliadis@fme.aegean.gr> wrote in message <ibbfkv$l6m$1@fred.mathworks.com>...
> Hello,
> I'd like to generate a vector of random numbers,which take values in any interval (e.g. [-1 1]),and this vector sums to 1...
>
> Thanx in advance...
> Vassilis......

**the number 1 that is most right of binary number**Hello newsgroup,
In some of my work , I am dealing with binary numbers.
Dec Binary
----- -------------------
1 1 0 0 0
2 0 1 0 0
3 1 1 0 0
4 0 0 1 0
5 1 0 1 0
6 0 1 1 0
7 1 1 1 0
8 0 0 0 1
9 1 0 0 1
10 0 1 0 1
After converting a decimal number to its binary form using the "de2bi" function, for each digit, I need to find the posit...

**char(1) vs Number(1)**Quick check on whether char(1) is more efficient than number (1).
Basically storing a bit value of either 0 or 1. since this is a
numeric maybe its better to store this as number(1).
Did a simple test for 1million rows, the IO cost is the same but the
number of bytes is double with number(1).
This makes me think that char(1) is more efficient in storage.
any thoughts?
On Nov 30, 9:59=A0am, CrazyKarma <ska...@gmail.com> wrote:
> Quick check on whether char(1) is more efficient than number (1).
> Basically storing a bit value of either 0 or 1. since this is a
> nume...

**Random numbers in range [-1,1]**Hi all,
How do I get random numbers that are not restricted to
positive values, i.e., random values in the range [-1,1]?
Thanks
"Di " <startnewd@gmail.com> wrote in message <fd8ie7$pv5
$1@fred.mathworks.com>...
> Hi all,
>
> How do I get random numbers that are not restricted to
> positive values, i.e., random values in the range [-1,1]?
>
> Thanks
If you have a function generating positive random numbers
between 0 --> 1 try subtracting 0.5, then multiplying by 2.
Stage 1 gives you random numbers between -0.5 & +0.5,
multiplying by 2 ...

**Numbers 1.0.1 available**Performance sucks less, but still sucks.
Machine is a 2x1.8GHz G5 with 1GB of RAM and OS X 10.4.10.
I had in AppleWorks a table that was 8 columns wide and several thousand
rows. The first six columns were data. The seventh was a formula
involving columns 2,3,5,6 of its own row. The eighth was a formula
involving column 6 of its own row and the prior row.
AppleWorks was always lightning fast, even when I was running on a
G4/450 (under 10.3, with 512MB).
Numbers 1.0 was so slow that I decided I didn't _really_ need column 8.
That did help a lot. Even so, edits to the columns refere...