So if I have a 6x2 array, lets say:
[0 0 0 0 0 0]' and [2 2 2 2 2 2]'
how do I use matlab to find an average vector of these vectors so that it returns for example [1 1 1 1 1 1]'?

답변 (2개)

Ameer Hamza
Ameer Hamza 2020년 11월 22일

1 개 추천

You can specify the dimension in mean() function. For example
x = [0 2;
0 2;
0 2;
0 2;
0 2;
0 2];
y = mean(x, 2)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

질문:

2020년 11월 22일

댓글:

2020년 11월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by