listbox with exclude option
显示 更早的评论
Hi all,
I have a listbox in my GUI which allow user to exclude certain data points before plotting. My current code is roughly listed as following:
datasetFull = get(hObject,'UserData');
datapointKept=get(handles...,'UserData');
for m = datapointKept
datasetFilter{m}=datasetFull{1,m};
end
datasetForPlot = datasetFilter(~cellfun('isempty',datasetFilter)); % delete empty array
plot(datapointKept,datasetForPlot);
If i have 3 data points in total, I want to exclude data point #1, choose to plot data point#2/#3 using this coding. However, the outcome is... it is still plotting data point #1/#2, it does skip the correct data point, instead it starts from #1 till 'datapointKept' progressively.
May I know how to solve this problem? Thanks!
回答(1 个)
Jan
2015-11-23
0 个投票
Did you use the debugger to examine the contents of datapointKept? I guess there is a bug in the code, when the corresponding UserData are set, but as long as this part is not posted in the forum, it is impossible to find the problem.
类别
在 帮助中心 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!