Help Debugging Code? Says there are not enough input arguments
6 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!