How can i connect this plot line

6 ビュー (過去 30 日間)
Near Fiern
Near Fiern 2023 年 12 月 8 日
回答済み: Sam Chak 2023 年 12 月 8 日

axes (handles.axes_L)

hold on

plot (LAB, LxAB,':or', LCB, LxCB,':or')

title ('Diagram Lintang')

xlabel('jarak (m)')

ylabel('gaya lintang (ton)')

grid on;

hold off

hold on

plot (LAB, 0,':or', LCB,0,':or')

  1 件のコメント
Near Fiern
Near Fiern 2023 年 12 月 8 日
Plz help.

サインインしてコメントする。

回答 (2 件)

Florian Bidaud
Florian Bidaud 2023 年 12 月 8 日
You have to concatenate the vectors.
Let's say your first line in defined by (x1, y1), and your second line by (x2, y2), then instead of :
plot(x1,y1,x2,y2)
You need to write:
plot([x1 x2],[y1 y2])
This is providing x2(1)>x1(end)

Sam Chak
Sam Chak 2023 年 12 月 8 日
It seems that the endpoint of LxAB is not the same as the starting point of LxCB. You can perform a logical test as shown below. A workaround is suggested, but this is considered as manipulating or changing data, which is unacceptable in academic and scientific practice.
Could you please clarify what you would like to plot over the distance (jarak)?
%% True (1) or False (0)
ToF = logical(LxAB(end) == LxCB(1))
ToF = logical
0
%% Workaround (but this is directly altering the data)
LxAB(end) = LxCB(1);
%% True (1) or False (0)
ToF = logical(LxAB(end) == LxCB(1))
ToF = logical
1

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by