Error in plot function
Show older comments
Hi I am plotting some results but getting an error in Plot Function. I am using MATLAB 2018b, below is my code
load MCAsLDA
MCAsLDA = table2array(MCAsLDA);
WindowSizes=MCAsLDA(:,1);
Data1Disjoint=MCAsLDA(:,2);
% Data1Disjoint=smooth(Data1Disjoint);
Data1Overlap=MCAsLDA(:,3);
% Data1Overlap=smooth(Data1Overlap);
Data2Disjoint=MCAsLDA(:,4);
% Data2Disjoint=smooth(Data2Disjoint);
Data2Overlap=MCAsLDA(:,5);
% Data2Overlap=smooth(Data2Overlap);
Data3Disjoint=MCAsLDA(:,6);
% Data3Disjoint=smooth(Data3Disjoint);
Data3Overlap=MCAsLDA(:,7);
f1=fit(WindowSizes,Data1Disjoint,'cubicinterp');
f2=fit(WindowSizes,Data2Disjoint,'cubicinterp');
f3=fit(WindowSizes,Data3Disjoint,'cubicinterp');
f4=fit(WindowSizes,Data1Overlap,'cubicinterp');
f5=fit(WindowSizes,Data2Overlap,'cubicinterp');
f6=fit(WindowSizes,Data3Overlap,'cubicinterp');
figure
hold on
p1=plot(f1,WindowSizes,Data1Disjoint,'LineWidth',2);
p2=plot(f2,WindowSizes,Data2Disjoint);
p3=plot(f3,WindowSizes,Data3Disjoint);
p4=plot(f4,WindowSizes,Data1Overlap);
p5=plot(f5,WindowSizes,Data2Overlap);
p6=plot(f6,WindowSizes,Data3Overlap);
grid on
title('Classification accuracy Vs. Window Sizes for LDA')
ylabel('Mean Classification Accuracy')
1 Comment
Adam Danz
on 19 Sep 2019
Always specify the entire error message.
The logical indices contain a true value outside of the
array bounds.
Error in cfit/plot (line 226)
handles =
plot(xpoints(~outliers),ypoints(~outliers),S2,...
Error in jff (line 26)
p1=plot(f1,[WindowSizes,Data1Disjoint],'LineWidth',2);
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!