This is a static copy of a profile report

Home

computenumber (Calls: 2, Time: 0.363 s)
Generated 04-Jun-2021 04:11:18 using performance time.
function in file C:\Users\willi\OneDrive\NTNU\Masteroppgave_Ke\Matlab\computenumber.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
script9script2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
50
if Table.(4)(rows) ~= newshort...
13980.158 s43.5%
47
newshorttable = Table(TF,:);
3600.076 s20.9%
46
TF = (Table.(3) == Table.(3)(r...
3600.067 s18.5%
48
if Table.(6)(rows) <= 3
3600.020 s5.5%
27
if Table.(6)(rows) <= 3
3600.017 s4.7%
All other lines  0.025 s6.9%
Totals  0.363 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
tabular.subsreffunction56920.229 s63.0%
categorical.nefunction13980.018 s4.8%
categorical.eqfunction3880.005 s1.5%
tabular.numArgumentsFromSubscriptfunction7200.001 s0.4%
tabular.heightfunction2940.001 s0.2%
Self time (built-ins, overhead, etc.)  0.110 s30.2%
Totals  0.363 s100% 
Code Analyzer results
Line numberMessage
5The value assigned to variable 'costweight1' might be unused.
Coverage results
Show coverage for parent directory
Total lines in function74
Non-code lines (comments, blank lines)40
Code lines (lines that can run)34
Code lines that did run34
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
   1 
function [outputcost1, outputcost2, outputcost3] = computenumber(Table)
   2 
%UNTITLED2 Summary of this function goes here
   3 
%   Detailed explanation goes here
   4 
%check multible exams at same time
< 0.001 
      2 
   5
costweight1 = 200; 
< 0.001 
      2 
   6
costweight2 = 200; 
< 0.001 
      2 
   7
costweight3 = 10; 
   8 

< 0.001 
      2 
   9
outputcost1 = 0; 
< 0.001 
      2 
  10
outputcost2 = 0; 
< 0.001 
      2 
  11
outputcost3 = 0; 
  12 

< 0.001 
      2 
  13
for rows = 1:height(Table) 
  14 
    
  15 
%     %check if allocated is same as behov
  16 
%     if Table{rows,1} == Table{rows,6}
  17 
%         cost1 = costweight1*1;
  18 
%     else
  19 
%         cost1 = costweight1*0;
  20 
%     end
  21 
    
< 0.001 
    360 
  22
    cost1 = 0; 
  23 
    
  24 
    
  25 
    %check if student want to sit with other student
  26 
    %check if not empty
  0.017 
    360 
  27
    if Table.(6)(rows) <= 3 
  0.015 
    292 
  28
        if Table.(2)(rows) == "" 
< 0.001 
    264 
  29
            cost2 = costweight2*0; 
< 0.001 
     28 
  30
        else 
  0.007 
     28 
  31
            if Table.(4)(rows) == Table.(4)(Table.(2)(rows)) 
< 0.001 
     19 
  32
                cost2 = costweight2*0; 
< 0.001 
      9 
  33
            else 
< 0.001 
      9 
  34
                cost2 = costweight2*1; 
< 0.001 
     28 
  35
            end 
< 0.001 
    292 
  36
        end 
< 0.001 
    360 
  37
    end 
  38 
    
< 0.001 
    360 
  39
    cost3 = 0; 
  40 
    
  41 
    %sjekke etter om studenter sitter på samme rom med andre studenter som
  42 
    %har samme faglærer
  43 
    %øke kostnad på de som ikke sitter sammen med samme faglærer
  44 
    
  45 
    %extract entries with same Faglaerer and same BehovForArbeidsplass
  0.067 
    360 
  46
    TF = (Table.(3) == Table.(3)(rows) & Table.(10) == Table.(10)(rows)); 
  0.076 
    360 
  47
    newshorttable = Table(TF,:); 
  0.020 
    360 
  48
    if Table.(6)(rows) <= 3 
  0.001 
    292 
  49
        for rows2 = 1:height(newshorttable) 
  0.158 
   1398 
  50
            if Table.(4)(rows) ~= newshorttable.(4)(rows2) 
< 0.001 
     86 
  51
                cost3 = cost3 + costweight3*1; 
< 0.001 
   1398 
  52
            end 
< 0.001 
   1398 
  53
        end 
< 0.001 
    360 
  54
    end 
  55 
    
  56 
% gammel versjon for sjekk av samme faglærer
  57 
%     for rows2 = 1:height(Table)
  58 
%         if Table{rows,1} == Table{rows2,1}
  59 
%             if strncmpi(Table{rows,3}, Table{rows2,3}, 10)
  60 
%                 if strncmpi(Table{rows,4}, Table{rows2,4}, 10)
  61 
% 
  62 
%                 else
  63 
%                     cost3 = cost3 + costweight3*1;
  64 
%                 end
  65 
%             end
  66 
%         end
  67 
%     end
  68 

< 0.001 
    360 
  69
    outputcost1 = outputcost1 + cost1; 
< 0.001 
    360 
  70
    outputcost2 = outputcost2 + cost2; 
< 0.001 
    360 
  71
    outputcost3 = outputcost3 + cost3; 
< 0.001 
    360 
  72
end 
  73 

< 0.001 
      2 
  74
end