Plot cummulative values without creating a cumulative vector with the values

I have a set of variables which represent the power output of several generators. I'm trying to obtain a plot in which the values are stacked on top of each other as seen in the following image, whitout the neccesity of creating another variable in which I make the cummulative sum.
Any idea which plot variation can achieve something similar to this?

回答 (2 件)

Star Strider
Star Strider 2022 年 4 月 5 日

1 投票

I am not certain what you are asking.
The posted plot can be created by the area function in MATLAB.

2 件のコメント

Rafael Inarejo
Rafael Inarejo 2022 年 4 月 5 日
Thanks! That's the function i needed.
Star Strider
Star Strider 2022 年 4 月 5 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

Jan
Jan 2022 年 4 月 5 日

0 投票

This cannot work. To get the y value of the line, you do have to perform a cumulative sum. There is no chance to avoid this calculation and I do not see a reason, why to avoid this.

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

製品

リリース

R2019a

質問済み:

2022 年 4 月 5 日

コメント済み:

2022 年 4 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by