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!

Antworten (1)

Jan
Jan am 23 Nov. 2015

0 Stimmen

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.

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Hilfe-Center und File Exchange

Gefragt:

PF
am 23 Nov. 2015

Beantwortet:

Jan
am 23 Nov. 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by