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!