![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1708466/image.jpeg)
Change dimension of a structure
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello, I need help with changing the height and width of my structure array. I will attach the picture below.
I want to change the height from 3601 to 3600 and change the width from 3602 to 3601.
댓글 수: 1
Stephen23
2024년 6월 3일
"Change dimension of a structure"
"Hello, I need help with changing the height and width of my structure array"
Your structure is scalar, ie. it has size 1x1. This is explicitly shown in your screenshot:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1708466/image.jpeg)
Do you really want to change the size of the structure array or (much more likely) do you just want to change the values of some fields within your scalar structure ?
답변 (1개)
Matt J
2024년 6월 3일
s.Height=3600;
s.Width=3601;
댓글 수: 4
Stephen23
2024년 6월 3일
"This is because I need my structure array called GeoTifData to be 3600 x 3601 so that it matches the size of the other arrays."
Then you need to resample the data. Simply changing the HEIGHT and WIDTH field values is unlikely to work.
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!