Home > data-access > get_variable_path.m

get_variable_path

PURPOSE ^

convert SID and var name into a path, which might exist.

SYNOPSIS ^

function [ complete_path ] = get_variable_path( subject_id, variable_name )

DESCRIPTION ^

convert SID and var name into a path, which might exist.
   get_variable_path(SUBJECT_ID, VARIABLE_NAME)

   Converts the information in the arguments into the pathname where this
   variable file should live, assuming it exists.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ complete_path ] = get_variable_path( subject_id, variable_name )
0002 %convert SID and var name into a path, which might exist.
0003 %   get_variable_path(SUBJECT_ID, VARIABLE_NAME)
0004 %
0005 %   Converts the information in the arguments into the pathname where this
0006 %   variable file should live, assuming it exists.
0007 
0008 
0009 % TODO: make variable_name optional, if not supplied, just give the
0010 % directory where variables will live under this subject (..../derived)
0011 
0012 var_dir = [get_subject_dir(subject_id) filesep() 'derived'];
0013    
0014 if nargin == 2
0015     complete_path = [var_dir filesep() variable_name '.mat'];
0016 else
0017     complete_path = var_dir;
0018 end
0019 
0020 end

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005