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

1 visualización (últimos 30 días)
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 comentarios
Rik
Rik el 21 de Mayo de 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.

Iniciar sesión para comentar.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 19 de Mayo de 2020
Editada: Ameer Hamza el 19 de Mayo de 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);

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by