Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
GPS-Tracking-of-On-Campus-Walking-Project/MATLAB_Functions/HuskyTrack/SenDes_HuskyTrack/PullData.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (30 sloc)
1.46 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% | |
% Function: PullData | |
% Author: Michael T. Ballard (michael.ballard@uconn.edu) | |
% Date: Spring 2019 | |
% | |
% Description: The PullData function opens a TCP connection to the | |
% specified host and places a query to the database designed for the | |
% HuskyTrack System. The response to this query is then collected and | |
% stored for further manipulations and analysis. Note that | |
% time is always considered to be 12:00 AM Midnight, thus the | |
% end date is exclusive. | |
% | |
% Parameters: url - A URL to access the host database's API from | |
% ie. 'http://sdp40.cse.uconn.edu/api/' | |
% startTime - A time stamp to indicate the earliest desired | |
% data. In the form 'YYYYMMDD', ie. 20190503 | |
% (May 3, 2019) | |
% endTime - A time stamp to indicate the latest desired | |
% data. In the form 'YYYYMMDD', ie. 20190503 | |
% (May 3, 2019) | |
% | |
% Return: dataMat - A struct containing all users and their | |
% location data retrieved from the host | |
% | |
function [dataMat] = PullData(url, startTime, endTime) | |
api = [url 'locationdata?start=' startTime 'T000000&end=' endTime 'T000000']; | |
options = weboptions('ContentType', 'json'); | |
data = webread(api); | |
dataMat = jsondecode(data); | |
end | |