문제

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?

도움이 되었습니까?

해결책

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, [] );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top