Hey guys I have a simple question,
I have a 5x 3 array with the 1st column representing the project number, 2nd column representing the start time and 3rd col representing the end time.
- Now I just need to plot this in a Gantt Chart.
Heres the script:
clc; clear all; close all; rng('default'); T = [1 randi([10 20]) 2 randi([10 20]) 3 randi([10 20]) 4 randi([10 20]) 5 randi([10 20])]D = projectscheduling(T);
And here is the function:
Brief summary of this function.Detailed explanation of this function.function [time] = projectscheduling(T)time = zeros(5, 3); for i = 2:5 time(1 ,1) = 1; time(1, 2) = 0; time(1 , 3) = T(1, 2); time(i , 1) = T(i , 1); time(i, 2) = time(i-1, 3); time(i, 3) = T(i , 2) + time(i, 2); enddisp(time); end
And here's a pic of what the finished plot should look like:
Best Answer