I need a hand with some graph function... :O

Is there a way to use the 'hold' command to keep only selected graphs and get rid of the others?
Thanks in advance

 채택된 답변

Star Strider
Star Strider 2017년 12월 21일

0 개 추천

I am not certain what you want to do. You may not need to use hold at all.
Try this:
x = linspace(-1, 1);
figure(1)
L1 = line('XData',x, 'YData',2*x);
L2 = line('XData',x, 'YData',x.^2);
set(L1, 'LineStyle','none') % Using ‘set’
L1.LineStyle = 'none'; % Using Structure
grid

댓글 수: 4

set(L1, 'LineStyle','none')
L1.LineStyle = 'none';
I'm not really proficient with MATLAB, could you explain me what these two lines do please?
Thanks
Star Strider
Star Strider 2017년 12월 21일
They essentially render ‘L1’ invisible by setting the 'LineStyle' to 'none', or no plotted line.
The information remains in your workspace, however the ‘L1’ line (x,y) values depicting it are not plotted.
help_me
help_me 2017년 12월 25일

Thanks Star Strider! Top man!

Star Strider
Star Strider 2017년 12월 25일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Networks에 대해 자세히 알아보기

태그

질문:

2017년 12월 21일

댓글:

2017년 12월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by