Structure declaration in Matlab
이전 댓글 표시
Hello, I have a matlab code piece having a structure defined. I want to define the structure wrap around to assign these data. The code is as below.
estruct.func_name = 'DATA_1';
estruct.variable(1).name = 't_user';
estruct.variable(1).req_dim = [901 2];
estruct.variable(1).var = data1;
estruct.variable(1).type = 'USR1';
estruct.variable(2).name = 'x_user';
estruct.variable(2).req_dim = [901 3; 901 4; 901 5; 1 3; 1 4; 1 5];
estruct.variable(2).var = data2;
estruct.variable(2).type = 'USR2';
: :
estruct.variable(10).name = 'p_user';
estruct.variable(10).req_dim = [1 4; 1 5];
estruct.variable(10).var = data10;
estruct.variable(10).type = 'USR10';
All i want is define a structure to accept/store this data. Can anyone help me out please
Srikanth
채택된 답변
추가 답변 (2개)
Srikanth
2012년 9월 4일
0 개 추천
댓글 수: 2
Walter Roberson
2012년 9월 4일
Leave out the { and } characters in the command Friedrich gave.
Srikanth
2012년 9월 4일
Srikanth
2012년 9월 4일
댓글 수: 4
Friedrich
2012년 9월 4일
Use ('name','') instead of []. When using[] ML assumes its double. Sorry, my fault
Srikanth
2012년 9월 4일
Friedrich
2012년 9월 4일
Is name always of fixed size? If so do 'name',blanks(n), where n is the size.
If not fix, you need to make it of dynamically size:
Srikanth
2012년 9월 5일
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!