フィルターのクリア

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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by