How to find a specific number in a specific column in an excel file and how many times it occurs
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I have been looking around for a solution to this problem, I have an excel file and it contains the number -1100 in the column with header "T". I want to find out how many times this number occurs in this given column. So I tried
[~, ~, data] = xlsread('test.xlsx');
data = string(data); % convert to string for easy comparision
rowsIndex = data(:, 1) == "T" && data(:, 2) == "-1100";
requiredRows = data(rowsIndex, :);
but this does not work. How can I find the number of times it occurs in the T column?
Thanks
댓글 수: 2
채택된 답변
VBBV
2024년 1월 31일
D = readtable('test.xlsx');
rowsIndex = D.T == -1100;
requiredRows = D(rowsIndex, :)
댓글 수: 4
추가 답변 (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!