Trying to get all values for corresponding columns

1 次查看(过去 30 天)
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