The document describes simulating a comparator using an artificial neural network in MATLAB. It involves: 1) writing code to generate random input and output for the comparator, 2) importing the data into the neural network tool, 3) creating a network with the specified inputs and outputs, 4) training the network, 5) simulating the trained network to view the weights, and 6) exporting the weights to the workspace and using them to simulate new outputs.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
793 views8 pages
Comparator Using ANN in NNtool
The document describes simulating a comparator using an artificial neural network in MATLAB. It involves: 1) writing code to generate random input and output for the comparator, 2) importing the data into the neural network tool, 3) creating a network with the specified inputs and outputs, 4) training the network, 5) simulating the trained network to view the weights, and 6) exporting the weights to the workspace and using them to simulate new outputs.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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. 5.Then select IMPORT in the NNTOOL box.Then import the required input and output variables. 4.Select nntool from the start menu of matlab.
After selection close that window.
5.Click on the NEW button. 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. 9.Then simulate the network.
10.click on the view weight bar we can saw the weight.
11.click on the EXPORT bar.
12.The required matrix are transfered to the workspace .