accessing double arrays in a multidimensional array

1 回表示 (過去 30 日間)
cgenes
cgenes 2016 年 11 月 22 日
コメント済み: cgenes 2016 年 11 月 22 日
Hi I have an array which is 256x156x1056 double. (X,Y,Z [where the Z has it's own X,Y])
1) How do you access the double? - i've read the documentation but it's not so clear to me i've tried C(1,1,1) for instance and it gives me a single value - -but I want the double value - i've tried C(1,1,{1,1}} but it doesn't like that 2) I also want an average Z[x,y] over a cropped area of X,Y (i.e. 50x50x1056 double) -basically combine all that Z info into a single graph
any suggestions?

採用された回答

James Tursa
James Tursa 2016 年 11 月 22 日
e.g.,
A = your 256x256x1056 array
B = mean(A,3); % <-- average of A over the 3rd dimension
C = mean(A(1:50,1:50,:),3); % <--average of 50x50 corner of A over the 3rd dimension
  2 件のコメント
cgenes
cgenes 2016 年 11 月 22 日
OK great thanks - i'll try that - - and what if I want to plot the Z[x,y], from 1 of the pixels e.g 100,100, plot(Z[x,y])?
cgenes
cgenes 2016 年 11 月 22 日
OK so in my array (output from cytospec) there is only 1 array of numbers in Z (the other array of numbers for the X values are held in a metafile - very confusing)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by