Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Discussion Groups | Matlab DSP | Re: Create Data Randomly

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

Create Data Randomly - Author Unknown - May 24 9:12:00 2004



Hi respected members,
I am new to Matlab and I am using its 5.3 version.
My problem is to create data randomly.
For my project, I have to create at least 100 matrices which should have the dimensions of mxn, where m=20,50 or 100
and n = 4m.
Also, the values in the matrices should range from a to b, where a and b are parametric values defined by the user.
So, I have identified the rand operator for my puspose,
and I am planning to use the following formulae:
 a + (b-a)rand()
Rand() operator produces values between 0 and 1, in this way, I have the values ranging between a and b.
But, I have no idea how to create the matrices automatically :(.
for achieving this, do I have to write a code in a file with the extention of m or something else?
I am really looking forward to hearing your recommendations for my problem.
Also, you can send me your sample codes if they also meet my partial desire.
Thanks for your attentions
best regards!...

Kaan KUMRU
System Development Department/Pamukbank T.A.Þ.

(: 0 212 275 24 24 - 1944
Ê: 0 212 288 61 79
*: kaan.kumru@pamukbank.com.tr


 





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

RE: Create Data Randomly - Jeff Winter - May 25 12:43:00 2004

Hi Kaan,
 
All you need to do is:

x = a + (b-a) * rand(m,n);
 
where m is the number of rows, n is the number of columns, a and b is the interval and x is the output matrix.
 
Hope this helps,
 
Jeff
 
====================
Jeff Winter
Snr Design Engineer
Aeroflex
www.aeroflex.com
 
 
 
 -----Original Message-----
From: k...@pamukbank.com.tr [mailto:k...@pamukbank.com.tr]
Sent: Monday, May 24, 2004 10:12 AM
To: Subject: [matlab] Create Data Randomly

Hi respected members,
I am new to Matlab and I am using its 5.3 version.
My problem is to create data randomly.
For my project, I have to create at least 100 matrices which should have the dimensions of mxn, where m=20,50 or 100
and n = 4m.
Also, the values in the matrices should range from a to b, where a and b are parametric values defined by the user.
So, I have identified the rand operator for my puspose,
and I am planning to use the following formulae:
 a + (b-a)rand()
Rand() operator produces values between 0 and 1, in this way, I have the values ranging between a and b.
But, I have no idea how to create the matrices automatically :(.
for achieving this, do I have to write a code in a file with the extention of m or something else?
I am really looking forward to hearing your recommendations for my problem.
Also, you can send me your sample codes if they also meet my partial desire.
Thanks for your attentions
best regards!...

Kaan KUMRU
System Development Department/Pamukbank T.A.Þ.

(: 0 212 275 24 24 - 1944
Ê: 0 212 288 61 79
*: kaan.kumru@pamukbank.com.tr


 


_____________________________________
/groups.php3




(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: Create Data Randomly - Sergio Dominguez - May 25 13:28:00 2004

El A las 12:12 del 24 de May de 2004, dijo:
> Hi respected members,
(snip)

> So, I have identified the rand operator for my puspose,

(snip)
>
> Kaan KUMRU

identified, but pretty clearly not even read the help!!

>> help rand

RAND Uniformly distributed random numbers.
RAND(N) is an N-by-N matrix with random entries, chosen from
a uniform distribution on the interval (0.0,1.0).
RAND(M,N) and RAND([M,N]) are M-by-N matrices with random entries.
RAND(M,N,P,...) or RAND([M,N,P,...]) generate random arrays.
RAND with no arguments is a scalar whose value changes each time it
is referenced. RAND(SIZE(A)) is the same size as A. Sergio

--
It's always darkest just before the lights go out.
-- Alex Clark




(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )