Getting joint lines in 2-D plot instead of a single line.
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm trying to plot a Force v/s Angle graph like this:
But I'm getting joint lines like this:
What am I doing wrong? Thank in advance for answering. Have a nice day :)
댓글 수: 1
채택된 답변
Sulaymon Eshkabilov
2023년 12월 23일
Small correction is needed with the indexing, see this sample code:
X = [ 0 5 10 15 -3 -5];
Y = [2*X.^2+2; 3*X.^2+2; 2.5*X.^2+5;]
figure
subplot(211)
plot(X, Y, '-s')
title('Wrong')
Xs=sort(X);
subplot(212)
plot(Xs, Y, '-o')
title('Corrected')
댓글 수: 2
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!