Creating multidimentional structures

How can I create a structure sized 100 x 100? Example of s = struct('f1', {1 3; 2 4}, 'f2', 25); creates a 2 x 2 structure, but s = struct('f1', {1:100; 1:100}, 'f2', 25); creates a 2 x 1 structure.
Can I change the array [1:100] to a list?

 채택된 답변

Sean de Wolski
Sean de Wolski 2012년 1월 25일

0 개 추천

s = struct('f1', num2cell(rand(100)), 'f2', 25);
You'll need 10000 data points. Above you provided 200.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2012년 1월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by