MATLAB Answers

Is it possible to set varargin from edit text (GUI)?

1 view (last 30 days)
Arwan Khoiruddin
Arwan Khoiruddin on 18 Jul 2014
Commented: Arwan Khoiruddin on 18 Jul 2014
I made a GUI-based matlab code using GUIDE. I have a function that have a varargin parameter as following:
function stocks = hist_stock_data(start_date, end_date, varargin)
I want to get all the three parameters using GUI input text. Here, varargin is intended for the stocks that will be retrieved from database. Therefore, the number of input should be flexible.
For start_date and end_date, I have done it by the following codes:
start_date = str2num(get(handles.edStartDate,'String')); end_date = str2num(get(handles.edEndDate,'String'));
However, I don't know how to get the varargin (stock data) from edStock.
Thank you for your kind help.

  4 Comments

Show 1 older comment
Arwan Khoiruddin
Arwan Khoiruddin on 18 Jul 2014
Thank you for your comment, Sara. The stock was retrieved from Yahoo! Finance's database. The function will be invoked as something like hist_stock_data('01011995','01072014','^FTSE', '^FTAS'). FTSE and FTAS are companies listed in Yahoo! Finance stock. I need to make the system to be dinamic, so user can load data from other companies as well, say it will be something like hist_stock_data('01011995','01072014','^GOOG'), means that it will take Google stock.
Sara
Sara on 18 Jul 2014
So, is your edBox where the user inputs what database to use, e.g. the user could write GOOG in there and your code go grabbing the right stock?
Arwan Khoiruddin
Arwan Khoiruddin on 18 Jul 2014
Yups. But the user may have one or several stock(s) to retrieve.

Sign in to comment.

Answers (0)

Tags