SUBSREF allows theta neuron network object fields to be subscript referenced Description: This function is called anytime a theta neuron network object field is subscript referenced use the subscript types '.','()' or '{}' Syntax: N/A Input Parameters: o N/A Output Parameters: o N/A Example: >> ThNN=theta_neuron_network; >> ThNN.Weights(1,3) See also theta_neuron_network
0001 function b = subsref(a,s) 0002 %SUBSREF allows theta neuron network object fields to be subscript referenced 0003 % 0004 %Description: 0005 %This function is called anytime a theta neuron network 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 %>> ThNN=theta_neuron_network; 0019 %>> ThNN.Weights(1,3) 0020 % 0021 %See also theta_neuron_network 0022 0023 %Copyright (C) 2008 Sam McKennoch <Samuel.McKennoch@loria.fr> 0024 0025 0026 b=a; 0027 for j=1:length(s) 0028 switch s(j).type 0029 case '.' 0030 b=b.(s(j).subs); 0031 case '()' 0032 b = b(s(j).subs{:}); 0033 case'{}' 0034 b = b{s(j).subs{:}}; 0035 otherwise 0036 error('Specify value for x as p(x)') 0037 end 0038 end