Skip to content

Commit

Permalink
Switched inputs round and added exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Alexander committed Nov 30, 2023
1 parent 519e1f4 commit bdea8ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions data_functions/bidsFilename.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [filename, folder] = bidsFilename(bids,cfg)
function [filename, folder] = bidsFilename(cfg,bids)
% Function to create a BIDS style filename. It is useful for saving and
% loading data. Use as:
% Usual bids info as structure containing strings:
Expand Down Expand Up @@ -39,7 +39,9 @@
cfg.description = 'folderOnly';
folderOnly = true;
end
if (~folderOnly && (~isfield(cfg,'type') || isempty(cfg.type)))
if folderOnly
cfg.type = '.mat';
elseif (~isfield(cfg,'type') || isempty(cfg.type))
disp('Defaulting cfg.type to .mat')
cfg.type = '.mat';
end
Expand Down

0 comments on commit bdea8ed

Please sign in to comment.