Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • ab20b0c
  • /
  • util
  • /
  • figures
  • /
  • readTDcsv.m
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:4a69afabf802766199b453700d894bfb62f61fe7
directory badge Iframe embedding
swh:1:dir:b060a8bc431ff235846ee186756b33ebf355f5a7
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
readTDcsv.m
%takes in 
function readTDcsv(fileNames, maxFrames)
    if nargin < 2
        maxFrames = -1;
    end
    fontSize = 8;
    fontName = 'Linux Biolinum O';
    hfig = figure('Renderer', 'painters', 'Units','Inches', 'Position', [0,0,3.3125,2]);%
    set(gcf,'color','w');
    hold on;
    %for i = 1:numel(fileNames)
       myTable1 = readtable(fileNames(1));
       myTable2 = readtable(fileNames(2));
       if maxFrames > 0
           myTable1 = myTable1(1:maxFrames, :);
           myTable2 = myTable2(1:maxFrames, :);
       end
       %col 10 is the total sim time and 11 is the time to compute the
       %energy
       times1 = table2array(myTable1(:,10)) - table2array(myTable1(:,11));
       st1 = sum(times1)
       times2 = table2array(myTable2(:,10)) - table2array(myTable2(:,11));
       st2 = sum(times2)
       timeNoContact1 = times1 - table2array(myTable1(:,15));
       stn1 = sum(timeNoContact1)
       timeNoContact2 = times2 - table2array(myTable2(:,15));
       stn2 = sum(timeNoContact2)

       totSpeedup = st2/st1
       totSpeedupNoContact = stn2/stn1

       speedup = times2./times1;
       meanspeed = mean(speedup)

       speedupNoContact = timeNoContact2./timeNoContact1;
       meanspeedNoContact = mean(speedupNoContact)

       plot([1:size(times1,1)]', speedup);
       plot([1, size(times1,1)], [meanspeed, meanspeed], 'g');
       string(num2str(speedup));
       ylabel('Speedup Factor');
       xlabel('Time Step');
    %end
    
    handle = gca;
    handle.Color = [0.95, 0.95, 0.95];
    handle.XLim = [0, size(times1,1)];
    handle.TickLength = [0,0];
    handle.YGrid = 'on';
    handle.GridColor = [1 1 1];
    handle.XColor = [0 0 0];
    set(gca, 'fontSize', fontSize, 'fontName', fontName);
%     set(hfig,'Units','Inches');
    pos = get(hfig,'Position');
    set(hfig,'PaperPositionMode','Auto','PaperUnits','Inches','PaperPosition',[0,0,3.3125,2]);%
    printSvg = strrep(fileNames(1),'.csv','.svg');
%     exportgraphics(gca,"benchmark/"+printPdf,'ContentType','vector');
    saveas(gca,"benchmark/"+printSvg)
    %legend(fileNames);
    
    
end

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API