-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Remi-Gau/fix_demos
[FIX] improve matlab demos and setup
- Loading branch information
Showing
9 changed files
with
128 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "matlab/fracridge"] | ||
path = matlab/fracridge | ||
url = https://github.com/nrdg/fracridge.git | ||
datalad-url = https://github.com/nrdg/fracridge.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function download_data(URL, input_file) | ||
|
||
if ~exist(input_file, 'file') | ||
|
||
% this fails on some machines ubuntu 18.04 | ||
if ispc | ||
system(sprintf('curl -L --output %s %s', input_file, URL)) | ||
|
||
else | ||
try | ||
urlwrite(URL, input_file); | ||
catch | ||
this_dir = fileparts(mfilename('fullfile')); | ||
if exist(fullfile(this_dir, 'download'), 'file') | ||
% remove eventual previously incomplete downloads | ||
delete(fullfile(this_dir, 'download')) | ||
end | ||
system(sprintf('wget --verbose %s', URL)); | ||
movefile(fullfile(this_dir, 'download'), input_file); | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
% This script adds GLMsingle to the MATLAB path. | ||
|
||
% Add GLMsingle to the MATLAB path (in case the user has not already done so). | ||
path0 = strrep(which('setup.m'),'/setup.m','/matlab'); | ||
addpath(genpath(path0)); | ||
clear path0; | ||
GLMsingle_dir = fileparts(mfilename('fullfile')); | ||
|
||
addpath(fullfile(GLMsingle_dir, 'matlab')); | ||
addpath(fullfile(GLMsingle_dir, 'matlab', 'utilities')); | ||
|
||
% if the submodules were installed we try to add their code to the path | ||
addpath(fullfile(GLMsingle_dir, 'matlab', 'fracridge', 'matlab')); | ||
|
||
% check that the dependencies are in the path | ||
tmp = which('fracridge.m'); | ||
if isempty(tmp) | ||
error('fracridge is missing. Please install from: https://github.com/nrdg/fracridge.git') | ||
end | ||
|
||
clear GLMsingle_dir; |