How using function Stairs for a market ?

geg

1 件のコメント

dpb
dpb 2018 年 4 月 4 日
Restore your original posting for context, Julien...

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

 採用された回答

dpb
dpb 2018 年 4 月 3 日
編集済み: dpb 2018 年 4 月 3 日

1 投票

S = [400 500 200]; % supply
PS = [15 25 55]; % Price supply
[PS,iPS]=sort(PS); % sort price ascending; keep in order with supply
S=S(iPS); % rearrange supply with sorted price
[PD,iPD]=sort(PD,'descend');
D=D(iPD);
figure
stairs([0 cumsum(S)],[PS PS(end)])
ylim([0 70])
hold on
stairs([0 cumsum(D)],[PD PD(end)],'r-')
yields:

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFinancial Toolbox についてさらに検索

タグ

質問済み:

2018 年 4 月 3 日

コメント済み:

dpb
2018 年 4 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by