How i can get graph in the form of line instead of points

조회 수: 2 (최근 30일)
usman younus
usman younus 2017년 6월 23일
답변: Guillaume 2017년 6월 23일
E=[7840.00,22690.00,44950.00,74630.00, 111730.00];
x=[5601,10000,13000,19000,250000];
c=48000;
for i=1:5
if(E(i)<c)
plot(x(i),E(i),'-');
hold on;
else
plot(x(i),c,'-')
hold on;
end
end

답변 (1개)

Guillaume
Guillaume 2017년 6월 23일
By not using a loop and if statements. Simply:
plot(x, min(E, c), '-')

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by