average data from excel sheet code

Hi, I have an excel sheet contains three arrays and its approximately 1000 points. The first column for longitude, the second for latitude and the third one for received power from an antenna and i want to make an average just for the received power points that have the same longitude and latitude and take just the average for them, can you help me and give me a hint or the m-code that i can use to edit this sheets?
Thank you :D

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 27일
편집: Azzi Abdelmalek 2013년 8월 27일

0 개 추천

your_array=xlsread('yourfile.xls')
%------------------------------------------------
[a,b,c]=unique(your_array(:,1:2),'rows','stable')
d=accumarray(c,your_array(:,3),[],@mean)
out=[your_array(b,1:2) d]

댓글 수: 4

Fadi
Fadi 2013년 8월 27일
Hi Azzi, i'll send to you the excel sheet on your e-mail to see it and to give me your help
Thanks
Fadi
Fadi 2013년 8월 27일
more information please
Put your xls file in your default folder.
your_array=xlsread('42752_Terrain umniah_section10.xls')
[a,b,c]=unique(your_array(:,1:2),'rows','stable')
d=accumarray(c,your_array(:,3),[],@mean)
out=[your_array(b,1:2) d]
Fadi
Fadi 2013년 8월 27일
it gives me this error.
??? Error using ==> unique at 33 Unrecognized option.
Error in ==> aaa at 2 [a,b,c]=unique(your_array(:,1:2),'rows','stable')
Thanks :D

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2013년 8월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by