필터 지우기
필터 지우기

x=0:pi/100:2*pi; y=sin(x); if x>3 plot(x,y,"b*") else x<=3; plot(x,y,"g*") end I Want PLot X>3 using Defferent Color

조회 수: 8 (최근 30일)
clc;clear;close all
x=0:pi/100:2*pi;
y=sin(x);
if x>3
plot(x,y,"b*")
else x<=3;
plot(x,y,"g*")
end

채택된 답변

Walter Roberson
Walter Roberson 2021년 12월 3일
x=0:pi/100:2*pi;
y=sin(x);
mask = x > 3;
plot(x(mask), y(mask), "b*")
hold on
plot(x(~mask), y(~mask), "g*")
hold off

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by