How using function Stairs for a market ?

 Respuesta aceptada

dpb
dpb el 3 de Abr. de 2018
Editada: dpb el 3 de Abr. de 2018
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:

Más respuestas (0)

Categorías

Más información sobre Financial Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Abr. de 2018

Comentada:

dpb
el 4 de Abr. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by