Toto je starší verze dokumentu!


Úkol 7

Kdyby nekdo chtel vykreslovat ganttuv diagram jako maji v pdfku, tak muzete pouzit tuto funkci:

function gantt( s, p, r, Cmax )
%GANTT Summary of this function goes here
%   Detailed explanation goes here
 
    x = r(s(1));
    y = 0;
    height = 2;
 
    hold on;            
 
    colors = ['r' 'g' 'b' 'y' 'm' 'c'];
    axis([x-1, Cmax+1, y, height + 1]);
 
    % create boxes       
    for i=1:length(p)
        rectx = [x, x, x+p(s(i)), x+p(s(i)), x];
        recty = [y, height, height, y, y];
        fill(rectx, recty, colors(mod(i, length(colors))));
        text(x + p(s(i))/2, y + height/2, ['\bf T_' num2str(s(i))], 'color', 'k');
        x = x+p(s(i));
    end;        
 
    hold off;
end
courses/a4b35ko/ukol7.1272116381.txt.gz · Poslední úprava: 2025/01/03 18:24 (upraveno mimo DokuWiki)
Nahoru
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0