Can I extract data from excel filtering a specific search word and its associated value on the next column?
조회 수: 3 (최근 30일)
이전 댓글 표시
Karla Haiat
2018년 1월 15일
댓글: Srikanth Reddy Pyata
2023년 6월 12일
Hello. I have an excel sheet and there is a column with different names of data, for example my column can have O2, oxygen or iron. the next column has actual number values. I know on excel you can filter your column to only show "O2" for example. Is there a way to do this with Matlab? I want to extract all the values on the column next to the names but only the values that match "O2"
댓글 수: 0
채택된 답변
Emmanouil Tzorakoleftherakis
2018년 1월 24일
Hi Karla,
You can do this by proper indexing of the columns. Please see code sample below:
data = {'O2', 5;'oxygen', 3;'iron', 2};
filtered = data(strcmp(data(:,1),'O2'), 2)
댓글 수: 1
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!