フィルターのクリア

Perform command on whole structure (reduce size)

12 ビュー (過去 30 日間)
Grant
Grant 2015 年 5 月 13 日
コメント済み: Grant 2015 年 5 月 13 日
Hello I have a data structure (named 'Data'). It is a mix of two and three tiers. It consists of a load of data arrays in roughly the same dimensions (9111 x 9021 or 9111 x 9020). I want to crop all of the arrays in one go i.e. I want a new structure which is the same but has (400:7000,4000:8000) of each array.
Is there a way to do this, instead of doing B1_2 = Data.sat.B1(400:7000,4000:8000); for every array?
Apologies if answered before, I couldn't find any results, perhaps b/c I'm not sure on the terminology. Thank you

採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 13 日
If it is a struct, use structfun with 'uniform', 0 . You will probably find it easier to write a small recursive routine:
function r = trimstruct(s)
if isstruct(s)
r = structfun(@trimstruct, s, 'Uniform', 0);
else
r = s(400:7000,4000:8000);
end
end
  1 件のコメント
Grant
Grant 2015 年 5 月 13 日
thanks a lot! perfect

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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