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.
multiple inputs through gui to workspace
5 次查看(过去 30 天)
显示 更早的评论
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!!
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!