Difference between () and ([])

What is the difference C=rand(4,10) and C=rand([4,10])

Answers (1)

KSSV
KSSV on 26 Dec 2017

0 votes

I don't think it makes any difference...both the cases you will get a random matrix of size 4X10...in fact [4,10] this needs a bit of more typing.

3 Comments

Prabha Kumaresan
Prabha Kumaresan on 26 Dec 2017
Edited: Walter Roberson on 26 Dec 2017
Ok .I would like to check is there any specific difference between them (4,10) and ([4,10]) other than the random matrix of size.
There is a very small difference in the time it takes to parse the arguments. There is no difference in the functionality.

Sign in to comment.

Categories

Find more on Random Number Generation in Help Center and File Exchange

Tags

Asked:

on 26 Dec 2017

Commented:

on 26 Dec 2017

Community Treasure Hunt

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

Start Hunting!