Change dimension of a structure

8 ビュー (過去 30 日間)
Jacey
Jacey 2024 年 6 月 3 日
コメント済み: Stephen23 2024 年 6 月 3 日
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
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:
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
Matt J 2024 年 6 月 3 日
s.Height=3600;
s.Width=3601;
  4 件のコメント
Jacey
Jacey 2024 年 6 月 3 日
This is the code. And I keep getting the error "Arrays do not have compatible sizes." 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.
Stephen23
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 ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by