3D Array manipulation

Hi,
I have a 8-by-8-by-24 Array S and I am trying to manipulate some of its elements. Specifically, say typing squeeze(S(2,3,1)) returns the value 6. Let's suppose I want to replace this element\number in S(2,3,1) by a zero value, so that the Array S now have 0 in S(2,3,1) instead of 6; I want to keep all other elements in S unchanged. What is the easiest thing for doing this? Any help is much appreciated. Thanks.

 採用された回答

Daniel Shub
Daniel Shub 2011 年 10 月 4 日

1 投票

You don't really need the squeeze in this case
squeeze(S(2,3,1))
is the same as
S(2,3,1)
To answer your question:
S = randn(8,8,24);
S(2,3,1) = 0;

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeConstruct and Work with Object Arrays についてさらに検索

質問済み:

C
C
2011 年 10 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by