Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is MATLAB This Cody problem serves as an introduction to Application Programming Interfaces (API's). These interfaces act as powerful tools to bridge applications to

This is MATLAB

This Cody problem serves as an introduction to Application Programming Interfaces (API's). These interfaces act as powerful tools to bridge applications to data sources such as a database. Please read the "What is an API?" discussion forum post on Edge if you have not already.

You are to write a function that returns the stock data to the user in a cell array, given some stock symbol input such as "AAPL." This function may be something a future employer would ask you to write if you are working on an analytical platform for stocks. You will be utilizing an Application Program Interface (API) from Markit to retrieve this data using the built-in function "webread." Webread makes an HTTP GET request to Markit given a URL endpoint and a key-value or multiple key-value pairs (kv).

The actual coding involved in this programming assignment is minimal and is meant to serve primarily as an introduction to some breadth topics you may find yourself using in the future.

Assign the following fields from the API response into a cell array. Your cell array should contain the following data (in order as below):

Stock Name, Stock Symbol, Last Price, % Change, and Time Stamp

guideline:

function data = stock_check(symbol) % Help: stock_check('AAPL') returns relevant stock data about Apple.

% Markit Quote Endpoint endpoint = 'http://dev.markitondemand.com/MODApis/Api/v2/Quote/json';

% Webread makes an HTTP GET request to Markit's Quote endpoint. % webread(endpoint, key, value)

% The request parameter for this API call is just the symbol, these % are in the form of 'key-value' pairs. Here the key is 'symbol' and the value % is a stock symbol (i.e. AAPL).

resp = webread(endpoint, 'symbol', symbol);

% Run this code in MATLAB to determine the output of the API. It should % return a data structure you are familiar with. Using the data structure, % figure out how to extract the status, name, sign, stock price, percent change, and time stamp.

% Begin your code here:

data =

end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago