I need some dummy data to a structure such as <64x64 double>. I am able to get <1x64 double> with 1:64
but how to get more dimensions to get <64x64 double>
in Matlab? I know I can do it like [1 2 3 4 ... 64; 1 2 3 ...64; ...; 1 2 3 ... 64]
but I am sure there must be some ready command do this fast with arbitrary dummy data. I am also looking for other dummy data generation commands. For example, how can I verify the data structure? Is the supposed way to look for the Workspace window for Name/Value/etc attributes?
Asked
Active
Viewed 224 times
-3

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

hhh
- 50,788
- 62
- 179
- 282
-
1From your recent questions, it looks like you need to sit down with a book on MATLAB before asking questions here. Agreed, SO is a place to learn, but it's not a place to ask first-time-user type of questions... – abcd Jan 29 '13 at 01:14
-
@LoremIpsum thank you, generalized it. Now better? – hhh Jan 29 '13 at 06:51
1 Answers
4
create a 64x64 all zeros:
a = zeros( 64 );
all ones:
a = ones( 64 );
random numbers:
a = rand( 64 );
1:64^2:
a = reshape( 1 : (64^2), 64, [] );

Shai
- 111,146
- 38
- 238
- 371
-
Thank you +1...is there a command to get increasing numbers? sort(rand(64))? Yes, it worked... :) – hhh Jan 28 '13 at 20:53