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

1 vue (au cours des 30 derniers jours)
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 commentaires
Rik
Rik le 21 Mai 2020
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.

Connectez-vous pour commenter.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 19 Mai 2020
Modifié(e) : Ameer Hamza le 19 Mai 2020
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);

Plus de réponses (0)

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by