multiple inputs through gui to workspace
3 views (last 30 days)
Show older comments
Hello. I have a premade function which accept varargin, up to 4 inputs. Also, I have made a listbox in a gui which can be chosen up to 4. I have made seperated push button which will open up the another figure to plot with the inputs that user chose in list box.
Following is the code I would like to try.
- plotting is the function I made, which will contains up to 4 inputs.(1,2,3 inputs are still ok)
- Convsig is a list box, And Plot is a push button
- Convsig will contain the set of variables as a list, and user choose the variables to plot
- After choosing the variables in Convsig, user press the 'Plot' button.
function Convsig_Callback(hObject, eventdata, handles)
contents = cellstr(get(hObject,'String'));
signals=contents{get(hObject,'Value')};
set(handles.Convsig,'String',signals);
function Plot_Callback(hObject, eventdata, handles)
plotsig=handles.Convsig;
evalin('base',plotting(plotsig));
I want to input the inputs that user chose from listbox and transfer those inputs into the .m function I made, which accept input as varargin format. Can anybody suggest a solution? Thank you!!
1 Comment
Walter Roberson
on 14 Aug 2017
What is the purpose of using evalin('base') to do the plotting? Graphics objects do not get deleted when the function that plots them returns, so it would not matter for plotting purposes if you called plotting() directly or in the base workspace. Are you expecting plotting to use assignin() to output values to the base workspace? If so then you could just assignin('base') instead of having to run the complete function inside the base workspace.
Answers (0)
See Also
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!