Help Debugging Code? Says there are not enough input arguments

Hello all,
I am having issues trying to debug this code that I was given. I have always struggled with trying to fix code that I myself did not create, so any advice on that would be helpful. I am pretty sure I need to have at least 4 input arguments in the function since there are 4 output arguments, but I am not sure what those ones would be. I thought initially it would be [open, high, low, close, date] in DisplayStockData but that didn't work. I also thought I may need an extra output argument in GetStockData, I tried a couple different ones but they did not work.
Thank you

Answers (1)

According to the function declaration line, ‘DisplayStockData’ wants 4 inputs and produces one output:
stockdata = DisplayStockData(symbol, startdate, frequency, periods)
Unfortunately, no variable is assigned as ‘stockdata’, that I can see anyway, so that will likely throw an error, as well as not return anything.
The ‘GetStockData’ function wants 4 inputs, and appears to assign values to all the outputs:
[open, high, low, close, date] = GetStockData(symbol, startdate, frequency, periods)
The characteristics of the arguments and outputs appears to me to be straightforward, otherwise.

Categories

Tags

Asked:

on 20 Sep 2017

Answered:

on 20 Sep 2017

Community Treasure Hunt

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

Start Hunting!