Hello Folks!
I have 165 text files consist of the single column. I want to save 165 columns in matlab format so that I can take the means of the average score. Kindly guide me in this regard. Thaking in anticipation.
Truly,
Adeel

댓글 수: 5

dpb
dpb 2021년 4월 6일
No need to necessarily create new file or hold all in memmory.
Just read each in turn and either accumulate sum and number if it is global mean wanted or compute the mean of each file and save in turn.
It's unclear what is the actual result wanted -- 165 means or just one?
Walter Roberson
Walter Roberson 2021년 4월 6일
What should be done if the text files do not all have the same number of columns ?
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan 2021년 4월 7일
I want to save the mean of each column from a single text file into a matlab format. I can copy and paste but it will take more time to do so. Thanks!
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan 2021년 4월 7일
@Walter Roberson Sir I have 165 text files in my directory, need to calculate the mean of each file and save in a matlab format. Kindly guide me in this regard. Thanking you in anticipation.

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

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 4월 7일

0 개 추천

Step 1. Data import from your txt file, e.g.: uiimport()
Step 2. Save imported data
Step 3. Compute the mean of the imported data using mean()
Step 4. Analyze and Report the results.
Good luck.

카테고리

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

태그

질문:

2021년 4월 6일

댓글:

2021년 4월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by