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

Revision f0c5c7cb930dc7952c24021113edac8be7e4bf32 authored by Guy Avraham on 26 October 2022, 13:32:18 UTC, committed by GitHub on 26 October 2022, 13:32:18 UTC
Create LICENSE
1 parent ac59451
  • Files
  • Changes
  • d8367b5
  • /
  • Codes
  • /
  • Functions
  • /
  • removeOutlierTrials_webBased.m
Raw File Download

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.

  • revision
  • directory
  • content
revision badge
swh:1:rev:f0c5c7cb930dc7952c24021113edac8be7e4bf32
directory badge
swh:1:dir:193f49a9bdac4e2d1bef674191f75e76c73c02a5
content badge
swh:1:cnt:c49c8f7f4a82474bac2dc8c0a177993cb0de7578

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.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
removeOutlierTrials_webBased.m
function ha = removeOutlierTrials_webBased(ha_org,i_newblock)

spikeThre=20;
nS=size(ha_org,1);
nT=size(ha_org,2);
for s=1:nS
    ha_withOutlierTrials=ha_org(s,:);
    
    trial_out1=find(ha_withOutlierTrials>70 | ha_withOutlierTrials<-50); % with the reasoning that people should adapt ~20deg in the positive direction
    if abs(ha_withOutlierTrials(1))>spikeThre % when the first trial has too large error
        trial_out1=[1 trial_out1];
    end
    
    dha_s=diff(ha_withOutlierTrials); % base on sudden change in hand angle
    diffLarge=find(abs(dha_s)>spikeThre)+1; % find how errors change from trial to trial
    iSpike=find(diff(diffLarge)==1); % a "spike" is when there is an oulier trial in which error was suddenly very different from the trial before and the trial after
    trial_out2=diffLarge(iSpike);
    trial_out2(trial_out2==i_newblock)=[];
    
    trial_out=[trial_out1 trial_out2];
    ha_withOutlierTrials(trial_out)=nan;
    
%     figure
%     plot(1:nT,ha_org(s,:),trial_out,ha_org(s,trial_out),'x')
%     title(['Subject #' num2str(s)],'fontsize',16)
    
    ha(s,:)=ha_withOutlierTrials;
end

end

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, 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— Content policy— Contact— JavaScript license information— Web API