Home > TNNT_1_07 > @theta_neuron > subsasgn.m

subsasgn

PURPOSE ^

SUBSASGN allows theta neuron object fields to be subscript assigned

SYNOPSIS ^

function a=subsasgn(a, s, b)

DESCRIPTION ^

SUBSASGN allows theta neuron object fields to be subscript assigned

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

Syntax:
N/A

Input Parameters:
o N/A

Output Parameters:
o N/A

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

See also theta_neuron

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function a=subsasgn(a, s, b)
0002 %SUBSASGN allows theta neuron object fields to be subscript assigned
0003 %
0004 %Description:
0005 %This function is called anytime a theta neuron object field is
0006 %subscript assigned 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 %Examples:
0018 %>> N=theta_neuron('Size', [3]);
0019 %>> N(2).InitialPhaseMethod{2}=1e-3
0020 %
0021 %See also theta_neuron
0022 
0023 %Copyright (C) 2008 Sam McKennoch <Samuel.McKennoch@loria.fr>
0024 
0025 %Limit possibilities based on the theta neuron object structure
0026 % TODO % - More Typechecking to Ensure Neuron Object is not being corrupted
0027 % through bad assignments
0028 if length(s)==3
0029         switch s(1).type
0030             case '()'
0031                 a(s(1).subs{:}).(s(2).subs){s(3).subs{:}}=b;
0032             otherwise
0033                 disp(['Error in theta neuron subsasgn: Invalid subscript assignment']);
0034                 a = -1;
0035                 return;
0036         end        
0037 elseif length(s)==2
0038         switch s(1).type
0039             case '()'
0040                 a(s(1).subs{:}).(s(2).subs)=b;
0041             case'{}'
0042                 a{s(1).subs{:}}.(s(2).subs)=b;
0043             otherwise
0044                 disp(['Error in theta neuron subsasgn: Invalid subscript assignment']);
0045                 a = -1;
0046                 return;
0047         end        
0048 elseif length(s)==1
0049         switch s(1).type
0050             case '.'
0051                 a.(s(1).subs)=b;
0052             case '()'
0053                 a(s(1).subs{:})=b;
0054             case'{}'
0055                 a{s(1).subs{:}}=b;
0056             otherwise
0057                 disp(['Error in theta neuron subsasgn: Invalid subscript assignment type - ' s(1).type]);
0058                 a = -1;
0059                 return;
0060         end    
0061 end

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