Professional Documents
Culture Documents
High-level script language with interpreter. Huge library of function and scripts. Act as an computing environment that combines
Entrance of matlab
>>
>> ver version of matlab and its toolboxes licence number >> whatsnew whats new of the version
keyword.
>> lookfor sum
TRACE Sum of diagonal elements. CUMSUM Cumulative sum of elements. SUM Sum of elements. SUMMER Shades of green and yellow colormap. UIRESUME Resume execution of blocked M-file. UIWAIT Block execution and wait for resume.
...
(similar to whereis in unix shell) >> which sum So that you can save it
sum is a built-in function.
/opt1/matlab-5.3.1/toolbox/nnet/nnet/sumsqr.m
Plotting graph
(for supervised learning) 5. Neural Network creation (selection of network architecture) and initialisation. 6. Network Training and Testing. 7. Performance evaluation.
Loading data
load: retrieve data from disk.Save variables in matlab environment and load back In ascii or .mat format.
>> data = load(wtest.txt); >> whos data; Name Size Bytes Class data 826x7 46256 double array
Matrix manipulation
for all
stockname = data(:,1);
Start for 1
training = data([1:100],:)
a=[1;2]; a*a => [1,2;2,4];
1 2 2 4
-1 -1 -1 -1
newff : create a feed-forward network. Description NEWFF(PR,[S1 S2...SNl],{TF1 TF2...TFNl},BTF,BLF,PF) takes, PR - Rx2 matrix of min and max values for R input elements. Si - Size of ith layer, for Nl layers. TFi - Transfer function of ith layer, default = 'tansig'. BTF - Backprop network training function, default = 'trainlm'. BLF - Backprop weight/bias learning function, default = 'learngdm'. PF - Performance function, default = 'mse and returns an N layer feed-forward backprop network.
TF2: logsig
TF1: logsig
Network Initialisation
Network Training
Network Training(contd)
train : train the network with its architecture. Description TRAIN(NET,P,T,Pi,Ai) takes, NET - Network. Training P - Network inputs. pattern 1 T - Network targets, default = zeros. Pi - Initial input delay conditions, default = zeros. Ai - Initial layer delay conditions, default = zeros.
-0.5 1 -1 0.5 0.5 1 -0.5 -1 -0.5 -1 0.5 -0.5 1 0.5 1 -1
For neuron 1
>> p = [-0.5 1 -0.5 1; -1 0.5 -1 0.5; 0.5 1 0.5 1; -0.5 -1 -0.5 -1];
Network Training(contd)
-1
-1
TRAIN(NET,P,T,Pi,Ai) takes, NET - Network. Training P - Network inputs. pattern 1 T - Network targets, default = zeros. Pi - Initial input delay conditions, default = zeros. Ai - Initial layer delay conditions, default = zeros.
>> p = [-0.5 1 -0.5 1; -1 0.5 -1 0.5; 0.5 1 0.5 1; -0.5 -1 -0.5 -1]; >> t = [-1 1 -1 1]; >> net = train(net, p, t);
Y
model UT
: Returned output in matrix or structure format. : Name of a block diagram model. : For table inputs, the input to the model is interpolated.
-0.5 -0.25 -1.00 -1.00 1.00 1.00 0.25 0.50
Training pattern 1
For neuron 1
Performance Evaluation
>> fname
function [Y , Z] = othername(str) Y = load(str); Z = length(Y);
loading.m
Reference