How to remove start and endpoint line?

2 views (last 30 days)
Supaporn Horthiwong
Supaporn Horthiwong on 8 Oct 2021
Commented: KSSV on 8 Oct 2021
I would like to remove contecting line between start and End point.
My script as below.
%% Plot Freq vs ErMag
figure; hold on;
xEval = TFAOut(strcmp(TFAOut.UserComp,'Eval'),:).Freq;
yEval = TFAOut(strcmp(TFAOut.UserComp,'Eval'),:).ErMag;
xCtrl = TFAOut(strcmp(TFAOut.UserComp,'Ctrl'),:).Freq;
yCtrl = TFAOut(strcmp(TFAOut.UserComp,'Ctrl'),:).ErMag;
plot(xEval,yEval,'r-',xCtrl,yCtrl,'b-');
grid on;

Answers (1)

KSSV
KSSV on 8 Oct 2021
Introduce NaN at the end of the line.
  2 Comments
KSSV
KSSV on 8 Oct 2021
Assuming your data is 1D row array:
xEval = [xEval NaN] ;
yEval = [yEval NaN];
xCtrl = [Xctrl NaN];
yCtrl = [yCtrl NaN] ;
plot(xEval,yEval,'r-',xCtrl,yCtrl,'b-');

Sign in to comment.

Categories

Find more on Structures in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!