Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Average from a excel sheet and store it to a different excel sheet.

조회 수: 2 (최근 30일)
Supriya Gain
Supriya Gain 2020년 8월 9일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a matrix file which consists of 2560 rows and 39 columns. In that file A3 and B3 consist of X and Y coordinate. C3 is time. Now i need to do average from D3 to G32 (it's like a 30X4 matrix). Now save the average value in a different excel sheet in this fashion like, in the new excel sheet A3 and B3 consist of that previous X and Y coordinate and C3 consist of the average value. Then i have to do average from H3:K32 and then save it under the same coordinate and beside the previous value, that means in D3.
Can anyone tell me how to do that?

답변 (1개)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020년 8월 9일
You should first read the data from the excel file using readmatrix, then do any calculations like mean, and finally write to the excel file using writematrix. For example:
MatrixInMatlab = readmatrix ('data.xlsx', 'Sheet','MySheet1', 'DataRange','A1:B10');
MeanInMatlab = mean (MatrixInMatlab, 2);
writematrix (MeanInMatlab, 'Sheet','MySheet2', 'DataRange','C1');

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by