Home > TNNT_1_07 > @theta_neuron > subsref.m

subsref

PURPOSE ^

SUBSREF allows theta neuron object fields to be subscript referenced

SYNOPSIS ^

function b = subsref(a,s)

DESCRIPTION ^

SUBSREF allows theta neuron object fields to be subscript referenced

Description:
This function is called anytime a theta neuron object field is 
subscript referenced use the subscript types '.','()' or '{}'

Syntax:
N/A

Input Parameters:
o N/A

Output Parameters:
o N/A

Example:
>> N=theta_neuron('Size', [3]);
>> N(2).InitialPhaseMethod{1}

See also theta_neuron

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function b = subsref(a,s)
0002 %SUBSREF allows theta neuron object fields to be subscript referenced
0003 %
0004 %Description:
0005 %This function is called anytime a theta neuron object field is
0006 %subscript referenced use the subscript types '.','()' or '{}'
0007 %
0008 %Syntax:
0009 %N/A
0010 %
0011 %Input Parameters:
0012 %o N/A
0013 %
0014 %Output Parameters:
0015 %o N/A
0016 %
0017 %Example:
0018 %>> N=theta_neuron('Size', [3]);
0019 %>> N(2).InitialPhaseMethod{1}
0020 %
0021 %See also theta_neuron
0022 
0023 %Copyright (C) 2008 Sam McKennoch <Samuel.McKennoch@loria.fr>
0024 
0025 b=a;
0026 for j=1:length(s)
0027     switch s(j).type
0028         case '.'
0029             b = b.(s(j).subs);
0030         case '()'
0031             b = b(s(j).subs{:});
0032         case'{}'
0033             b = b{s(j).subs{:}};
0034         otherwise
0035             disp(['Error in theta neuron subsref: Invalid subscript reference type - ' s(j).type]);
0036             b = -1;
0037             return;
0038     end
0039 end

Generated on Wed 02-Apr-2008 15:16:32 by m2html © 2003