필터 지우기
필터 지우기

Trying to get all values for corresponding columns

조회 수: 1 (최근 30일)
Nathaniel Porter
Nathaniel Porter 2022년 2월 24일
답변: Voss 2022년 2월 25일
1) Converted pdf to column vectors(string)
2) Trying to obtain all the values in fourth(glucose) corresponding to third column that range between (48-64)
3) Belive I am only getting the number of values related to each
clear
str = extractFileText("data-01.pdf");
data=split(str);
date=data(1:4:end)
time=data(2:4:end)
third=data(3:4:end)
glucose=data(4:4:end)
val = 0;
for k = 1:length(third)
if (k>= 48 && k<= 64)
val = (glucose(k,:));
end
end

채택된 답변

Voss
Voss 2022년 2월 25일
Hard to say for sure without the pdf file, but maybe something like this will work:
clear
str = extractFileText("data-01.pdf");
data=split(str);
date=data(1:4:end)
time=data(2:4:end)
third=data(3:4:end)
glucose=data(4:4:end)
val = [];
for k = 1:length(third)
third_val = str2double(third(k));
if third_val >= 48 && third_val <= 64
val(end+1) = str2double(glucose(k));
end
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by