help writing a script which outputs the daily percentage of positive COVID-19 cases

4 ビュー (過去 30 日間)
Hello all,
I'm trying to write a script which gives the daily percentage of positive COVID-19 cases for Oregon. So far I have
%Analysis of daily percentage of positive COVID-19 test in the state of Oregon
clc
clear all
close all
%load data from https://covidtracking.com/data/state/oregon
api='https://covidtracking.com/api/v1/states/OR/daily.json'
data=webread(api)
This gives a 76x1 cell with all 1x1 structres. I would like to get the data from these structers so I can use the variables to produce a best fit using either one of the two equations 1/x/a/sqrt(2*pi)*exp(-(log(x)-b)^2/2/a^2) where a,b are variables.
  3 件のコメント
Rik
Rik 2020 年 5 月 21 日
In response to your email: the preferred way is to leave a question as it was, instead of replacing it. Asking multiple questions is fine.
If you still have a copy of the original question text I don't see any issues with restoring it yourself. Otherwise you can leave it for a site admin to revert, but they are busy, so that can take up to several weeks to do.
Rena Berman
Rena Berman 2020 年 6 月 1 日
(Answers Dev) Restored edit

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 19 日
編集済み: Ameer Hamza 2020 年 5 月 19 日
This shows how to extract data from a particular field
api='https://covidtracking.com/api/v1/states/OR/daily.json';
data=webread(api);
dataTotal = cellfun(@(x) x.('total'), data);
dataPositive = cellfun(@(x) x.('positive'), data);
dataNegative = cellfun(@(x) x.('negative'), data);
  2 件のコメント
Tyde Hilderbrandt
Tyde Hilderbrandt 2020 年 5 月 20 日
Thanks, this helped alot.
Ameer Hamza
Ameer Hamza 2020 年 5 月 20 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by