How to access a row elements of a field of a structure
조회 수: 41 (최근 30일)
이전 댓글 표시
Hi,
I have a structure A and it has three feils f1,f2,f3. f2 have three rows and 10 columns. I want to access row 2 of columns.
I did like this but it give error.
A.f1{2,1}
How to access? kindly help.
댓글 수: 2
답변 (1개)
per isakson
2020년 5월 1일
Assumption: "three rows and 10 columns" refers to a 3x10 double matrix
Try
%%
A.f1 = randi( [0,9], 3, 8 ); % sample data
A.f1( 2, : )
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!