This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
script9script4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
46
if Table.(4)(rows) ~= newshort...
27960.316 s43.3%
43
newshorttable = Table(TF,:);
7200.155 s21.2%
42
TF = (Table.(3) == Table.(3)(r...
7200.136 s18.6%
44
if Table.(6)(rows) <= 3
7200.040 s5.5%
23
if Table.(6)(rows) <= 3
7200.034 s4.7%
All other lines  0.049 s6.7%
Totals  0.730 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
tabular.subsreffunction113840.463 s63.4%
categorical.nefunction27960.036 s4.9%
categorical.eqfunction7760.011 s1.5%
tabular.numArgumentsFromSubscriptfunction14400.003 s0.4%
tabular.heightfunction5880.001 s0.2%
Self time (built-ins, overhead, etc.)  0.216 s29.6%
Totals  0.730 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)39
Code lines (lines that can run)35
Code lines that did run35
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
   1 
function rowmostcost = getrowmostcost(Table)
   2 
%UNTITLED2 Summary of this function goes here
   3 
%   Detailed explanation goes here
   4 
%check multible exams at same time
< 0.001 
      4 
   5
costweight1 = 100; 
< 0.001 
      4 
   6
costweight2 = 200; 
< 0.001 
      4 
   7
costweight3 = 10; 
   8 

< 0.001 
      4 
   9
rowmostcost = 1; 
< 0.001 
      4 
  10
mostcost = 0; 
< 0.001 
      4 
  11
for rows = 1:height(Table)     
  12 
    %check if allocated is same as behov
  13 
%     if Table{rows,1} == Table{rows,5}
  14 
%         cost1 = costweight1*1;
  15 
%     else
  16 
%         cost1 = costweight1*0;
  17 
%     end
< 0.001 
    720 
  18
    cost1 = 0; 
  19 
    
  20 
    
  21 
    %check if student want to sit with other student
  22 
    %check if not empty
  0.034 
    720 
  23
    if Table.(6)(rows) <= 3 
  0.030 
    584 
  24
        if Table.(2)(rows) == "" 
< 0.001 
    528 
  25
            cost2 = costweight2*0; 
< 0.001 
     56 
  26
        else 
  0.014 
     56 
  27
            if Table.(4)(rows) == Table.(4)(Table.(2)(rows)) 
< 0.001 
     38 
  28
                cost2 = costweight2*0; 
< 0.001 
     18 
  29
            else 
< 0.001 
     18 
  30
                cost2 = costweight2*1; 
< 0.001 
     56 
  31
            end 
< 0.001 
    584 
  32
        end 
< 0.001 
    720 
  33
    end 
  34 
    
< 0.001 
    720 
  35
    cost3 = 0; 
  36 
    
  37 
    %sjekke etter om studenter sitter på samme rom med andre studenter som
  38 
    %har samme faglærer
  39 
    %øke kostnad på de som ikke sitter sammen med samme faglærer
  40 
    
  41 
    %extract entries with same Faglaerer and same BehovForArbeidsplass
  0.136 
    720 
  42
    TF = (Table.(3) == Table.(3)(rows) & Table.(10) == Table.(10)(rows)); 
  0.155 
    720 
  43
    newshorttable = Table(TF,:); 
  0.040 
    720 
  44
    if Table.(6)(rows) <= 3 
  0.002 
    584 
  45
        for rows2 = 1:height(newshorttable) 
  0.316 
   2796 
  46
            if Table.(4)(rows) ~= newshorttable.(4)(rows2) 
< 0.001 
    172 
  47
                cost3 = cost3 + costweight3*1; 
< 0.001 
   2796 
  48
            end 
< 0.001 
   2796 
  49
        end 
< 0.001 
    720 
  50
    end 
  51 
% gammel versjon for sjekk av samme faglærer
  52 
%     for rows2 = 1:height(Table)
  53 
%         if Table{rows,1} == Table{rows2,1}
  54 
%             if strncmpi(Table{rows,3}, Table{rows2,3}, 10)
  55 
%                 if strncmpi(Table{rows,4}, Table{rows2,4}, 10)
  56 
% 
  57 
%                 else
  58 
%                     cost3 = cost3 + costweight3*1;
  59 
%                 end
  60 
%             end
  61 
%         end
  62 
%     end
  63 

< 0.001 
    720 
  64
    rowcost = cost1 + cost2 + cost3; 
< 0.001 
    720 
  65
    if (rowcost > mostcost) 
< 0.001 
     14 
  66
        mostcost = rowcost; 
< 0.001 
     14 
  67
        rowmostcost = rows; 
< 0.001 
    720 
  68
    end 
  69 
       
< 0.001 
    720 
  70
end 
  71 

  72 
%rowmostcost
  73 

< 0.001 
      4 
  74
end 

Other subfunctions in this file are not included in this listing.