How using function Stairs for a market ?

 Akzeptierte Antwort

dpb
dpb am 3 Apr. 2018
Bearbeitet: dpb am 3 Apr. 2018

1 Stimme

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:

Weitere Antworten (0)

Kategorien

Mehr zu Financial Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 3 Apr. 2018

Kommentiert:

dpb
am 4 Apr. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by