How can i rearrange a vector ?

1 回表示 (過去 30 日間)
Abdelwahab Fawzy
Abdelwahab Fawzy 2015 年 9 月 1 日
コメント済み: the cyclist 2015 年 9 月 2 日
I need you help in matlab
if A=[8 1 12 3 6 10 13 3];
AVG=sum(A)/length(A);
i need to neglect all values that below the AVG
so i get B=[8 12 10 13]
can you help me to perform this task in general

採用された回答

the cyclist
the cyclist 2015 年 9 月 1 日
B = A(A>=mean(A))
  2 件のコメント
Abdelwahab Fawzy
Abdelwahab Fawzy 2015 年 9 月 1 日
編集済み: Abdelwahab Fawzy 2015 年 9 月 1 日
if i have number of nodes (8) each node has its ID as follow ID=[ 1 2 3 4 5 6 7 8]
each node has its related Power using structure array ID.power=A
A=[8 1 12 3 6 10 13 3]
you help me to rearrange the matrix A depending on the mean
what about rearranging the ID vector ?
thanks in advance
result ID=[1 3 6 7]
the cyclist
the cyclist 2015 年 9 月 2 日
I don't really understand the new question.
(Also, you might consider posting a new question. More people will see it.)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by