Help Debugging Code? Says there are not enough input arguments

1 回表示 (過去 30 日間)
Paige Moseley
Paige Moseley 2017 年 9 月 20 日
回答済み: Star Strider 2017 年 9 月 20 日
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

回答 (1 件)

Star Strider
Star Strider 2017 年 9 月 20 日
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.

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by