フィルターのクリア

How to compare matrix of different dimensions?

2 ビュー (過去 30 日間)
Anonymous Matrix
Anonymous Matrix 2017 年 2 月 22 日
コメント済み: Jan 2017 年 2 月 23 日
I've read the other posts regarding this problem and I'm kinda confused on how to compare 2 matrices of different dimensions. Say I have this code where the array ww is a 43x1 and the array w3 ended up being 20x1
ww=mean(array1,2)
w1=mean(array2,2)
w2=mean(array2,2)>5
w3=w1(w2)
w5=ww<w3
How can get the statement w5=ww<w3 to work (ie. compare those arrays)?
  4 件のコメント
Beder
Beder 2017 年 2 月 23 日
編集済み: Beder 2017 年 2 月 23 日
I assume you want to have w3 containing the elements where the mean of array2 is >5. To achieve this you can use logical indexing:
w2(w1>5)=w1;
w5=ww<w2
is that what you wanted?
Jan
Jan 2017 年 2 月 23 日
If the array has the size [43 x 1], the command mean(array, 2) does not do anything. Please give a small example with example data to explain, what you want to calculate. Seeing not working code is not enough to reconsider your intention.

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by