Extracting Data in Excel With Groups into Matlab
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello, I have a data in excel. Each row has a level from 1 to 10. Level shows subgroups. For example level 2 rows are subgroups of level 1 row. It goes like this. Is there a way that i can transfer it to matlab? It could be some cell in cell or a struct or is there anything else?
Also if there is a funtion that recognise levels, it could be very helpful
Example data:
Mass Level
23 1
10 2
2 3
8 2
13 2
10 3
3 3
댓글 수: 4
Dyuman Joshi
2023년 8월 8일
What is your data? Attach the excel file via the paperclip button.
How exactly do you want to group them?
답변 (1개)
Katy Weihrich
2023년 8월 4일
Matlab has a option that automatically generates a code for reading excel files.
Go to Home --> Import Data (under Variable) --> open the excle file you want to load in --> select options that you need --> click on Inport Selection --> Generate Script
Matlap will open a untiteled scriped with a code that loads the data as you wish.
Tips for the selection of option:
- You can select the format of the output under Output Type (in Improted data)
- You can change the format of the variable (e.g. change Number to Categorical) below the variable name.
- In Range deselect the first row with the variable names (e.g. A2:B8 instead of A1:B8)
- if you read text files (e.g. .cvs) you need to ensure that the correct delimiter is selected and if you used excle in Germany you need to change the decimal seperator (under delimiter options) to comma instead of periode.
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!