comparator using ann in nntool

8
SIMULATION OF COMPARATOR IN ANN 1. Wrote the code in MATLAB and stored it as an M file. 2. The code for generating input and output of the comparator is clc; clear; input=10*rand(1,100); for i=1:100 if (input(1,i)>5) a(1,i)=5; else a(1,i)=0; end end b=[input;a] 3.Run the program.

Upload: thomagt

Post on 16-Nov-2014

624 views

Category:

Documents


2 download

DESCRIPTION

how to create a comparator in mathlab using nntool

TRANSCRIPT

Page 1: comparator using ANN in NNtool

SIMULATION OF COMPARATOR IN ANN

1. Wrote the code in MATLAB and stored it as an M file.

2. The code for generating input and output of the comparator is clc;

clear; input=10*rand(1,100); for i=1:100

if (input(1,i)>5) a(1,i)=5; else a(1,i)=0; end end b=[input;a]

3.Run the program.

Page 2: comparator using ANN in NNtool

5.Then select IMPORT in the NNTOOL box.Then import the required input and

output variables.

Page 3: comparator using ANN in NNtool

4.Select nntool from the start menu of matlab.

After selection close that window.

Page 4: comparator using ANN in NNtool

5.Click on the NEW button.

Page 5: comparator using ANN in NNtool

6. Select input and target. Define the number of neurons. Then click on CREATE.

After that close that box.

7.In the Network/data manager box double click on the network.

A new window is opened.

8.click on train and assigned the proper input and output variables.Then click train

network.

Page 6: comparator using ANN in NNtool

9.Then simulate the network.

10.click on the view weight bar we can saw the weight.

Page 7: comparator using ANN in NNtool

11.click on the EXPORT bar.

12.The required matrix are transfered to the workspace .

Page 8: comparator using ANN in NNtool

13.Then use sim command to see the output.