how to obtain a vector contains a mean of other vector

i have an array describes x and y values of 3 points
v=[26 196 27 196 28 196]
i wanna have as a result a vector that :
v1= [mean of(26,27,28) mean of (196,196,196)]
thank you for the help

 採用された回答

Mohammad Abouali
Mohammad Abouali 2015 年 12 月 16 日

0 投票

v=[26 196 27 196 28 196];
v1=[mean(v(1:2:end)) mean(v(2:2:end))]
v1 =
27 196
You really need to have a look at MATLAB Primer.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

質問済み:

2015 年 12 月 16 日

コメント済み:

2015 年 12 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by