plotting plus minus 10% variation of a vector in matlab

1 回表示 (過去 30 日間)
Sumera Yamin
Sumera Yamin 2020 年 11 月 10 日
コメント済み: Sumera Yamin 2020 年 11 月 10 日
Hi, I need some help with plotting. I have plotted two vectors A and B. Now I want to introduce a variation in vector A (10% variation dependent on some function, for simplicity, let's suppose linear), and plot on top of A as a shaded (continuous) error bar . How can I do such a plot in Matlab? (Something like attached picture, red line is actual data and blue is the variation in data). Many thanks for the help.
  2 件のコメント
Adam Danz
Adam Danz 2020 年 11 月 10 日
No attachment.
This function from the file exchange is one of the go-to's for shaded errorbars
The 10% variation can merely be added to your data (+/- 5%, most likely). For example, you could use the range function and multiply it by 5%, then use rand or randi to generate random numbers within that range and add/subtract them to/from the data.
Sumera Yamin
Sumera Yamin 2020 年 11 月 10 日
many thanks for pointing out this function. This is exactly what i was looking for.

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by