How to plote Data with Jump condition?

2 ビュー (過去 30 日間)
Ali Kareem
Ali Kareem 2016 年 3 月 3 日
コメント済み: Walter Roberson 2016 年 3 月 3 日
Hi,
I am trying to plot data. The problem I have jump condition in that data. I searched to find any way to do that but I can not find anything.
x y Jump(y)
0.783 0.56
1.02 0.8
1.5 1.34 2.89
2 3.8
2.16 3.91
3 4.7 6.3
I have Jump in that data in two place at x=1.5 and x=3.
Can MatLab plot data that has jump condition. it is like step function which at same x- coordinate will have two value for y- corrdeinate. Or like shock wave which at the shock the properties change suddenly.
Thanks

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 3 月 3 日
Start constructing a list of x and y coordinates. When you get to the line with the jump, add the x with the first y, and also add the x with the jump value. Then keep going in the list. Now plot(x,y)
  2 件のコメント
Ali Kareem
Ali Kareem 2016 年 3 月 3 日
Hi, Thank you for your reply. This means if let says y=20 between x=1:40 then y=30 between x=40:80 this mean I will have 81 points for x (and if I have loop to save the values in matrix I will need 2*81) instead of (2*80)
Thanks
Walter Roberson
Walter Roberson 2016 年 3 月 3 日
Yes.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by