필터 지우기
필터 지우기

Getting joint lines in 2-D plot instead of a single line.

조회 수: 2 (최근 30일)
Vaishali
Vaishali 2023년 12월 23일
댓글: Sulaymon Eshkabilov 2023년 12월 23일
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
Matt J
Matt J 2023년 12월 23일
편집: Matt J 2023년 12월 23일
What am I doing wrong?
How are we to have any idea what you are doing, when you've provided no code and input data?

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

채택된 답변

Sulaymon Eshkabilov
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;]
Y = 3×6
2.0000 52.0000 202.0000 452.0000 20.0000 52.0000 2.0000 77.0000 302.0000 677.0000 29.0000 77.0000 5.0000 67.5000 255.0000 567.5000 27.5000 67.5000
figure
subplot(211)
plot(X, Y, '-s')
title('Wrong')
Xs=sort(X);
subplot(212)
plot(Xs, Y, '-o')
title('Corrected')
  댓글 수: 2
Vaishali
Vaishali 2023년 12월 23일
Thank you so much !
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 12월 23일
Mopst welcome! Glad to be of some help :)

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

추가 답변 (0개)

카테고리

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