I am working on a script to process specific data. But I am stuck because I want to calculate an average based on x-values that I obtained with ginput. The script must be able to be used for different data sets and this means that the number of values on which an average must be calculated can vary. It can vary between 4 and 16 value's. Can someone help me?

 채택된 답변

Stephan
Stephan 2018년 8월 31일
편집: Stephan 2018년 8월 31일

0 개 추천

If you use a syntax like this for ginput:
[x,y] = ginput(n)
all the input values (no matter if 4 or 16) are stored in vectors x and y. Then use mean:
mean_x = mean(x)
mean_y = mean(y)
to get what you want.
Best regards
Stephan

추가 답변 (0개)

카테고리

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

질문:

2018년 8월 31일

댓글:

2018년 8월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by