How to seperate positve and negative x axis

조회 수: 6 (최근 30일)
Antonio Sarusic
Antonio Sarusic 2020년 3월 6일
댓글: Star Strider 2020년 3월 6일
Hello,
I have a function and I want to examine the curve of the function only for positive x values.
Does anyone have an ideo how i could do that?
I attached an image of how my function looks.

채택된 답변

Star Strider
Star Strider 2020년 3월 6일
Try this:
F = openfig('Bild_versch.fig');
Lines = findobj(F, 'Type','Line');
X = Lines.XData;
Y = Lines.YData;
LM = X > 0; % Logical Mask: Only Positive ‘X’ Values
figure
plot(X(LM), Y(LM))
grid
xlim([0 0.005]) % Optional
Note that since 0 has no sign, it is not considered to be either positive or negative. To include it, change the ‘LM’ assignment to:
LM = X >= 0; % Logical Mask: Only Non-Negative ‘X’ Values
  댓글 수: 4
Antonio Sarusic
Antonio Sarusic 2020년 3월 6일
Thank you very much
Star Strider
Star Strider 2020년 3월 6일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by