Showing posts with label Matlab Toolboxes. Show all posts
Showing posts with label Matlab Toolboxes. Show all posts

Wednesday, 9 May 2012

Matlab PCA Dimensionality Reduction code,Matlab Toolbox for Dimensionality Reduction

Matlab dimensionality reduction is main process on more research domains.Here we mention some one toolbox for Dimensionality Reduction.This toolbox contain many type of dimensionality reduction techniques are there.

Toolbox home page as below.

http://homepage.tudelft.nl/19j49/Matlab_Toolbox_for_Dimensionality_Reduction.html

Just you download the toolbox.Then add the path of toolbox.click here and check how to set the path for toolboxes.Then compute the dimension reduction on your work.following example for set the path and compute the DR using PCA(Principal Component Analysis)

Code :

>> addpath(genpath('installation_folder/drtoolbox')).
>> mapped_data = compute_mapping(your_data, method, reduction of dimensions, parameters of techniques);

above code to set the path of DM toolbox and calling main function.

Related Search : Matlab PCA Dimensionality Reduction code,Matlab Toolbox for Dimensionality Reduction ,Probabilistic PCA Dimensionality Reduction matlab code,Kernel PCA Dimensionality Reduction matlab code

Friday, 27 April 2012

Matlab invalid mex file error ,matlab configure mex setup

"Invalid mex file error" shows on run time error.Error solve use the third-party product.Just configure third-party product your matlab.Then proper check your matlab version with supported third-party product versions.

  1. Matlab mexw32 file are using correct mex -setup. 
  2. Choose your Correct Cpp compiler
  3. Recompile your C and Cpp files.
Then Run your Program .Error will removed..

Related Search :  invalid mex file error ,Matlab  invalid mex file error ,matlab configure mex setup,matlab compile c and cpp files.

Thursday, 5 April 2012

Matlab ANFIS (Adaptive Neuro-Fuzzy Inference Systems) Example code | AnFis Matlab Example code

Anfis is one of the toolbox on matlab.Its most important on research works.Anfis is collaboration of Neural network and Fuzzy logic.Its mostly use in classification section.

In below we give some examples of Anfis on Matlab

In goto your matlab command window then type "anfisedit" then you sea editor of anfis.


In coding wise you have use following commands and syntax's.

Training Section code

input = [0 1 2 3 4 5 6 7 8 9]; % Input data
output = [1 1 1 1 1 2 2 2 2 2];% data class

trnData = [input' output'];

numMFs = 5;

mfType = 'gbellmf';

epoch_n = 20;
in_fis = genfis1(trnData,numMFs,mfType);
out_fis = anfis(trnData,in_fis,20);


then you sea following output


Testing a Anfis

Just use evalfis command.Its predefined function on matlab for evaluating a fuzzy.

>> evalfis(1,out_fis)
ans = 1.0000
>> evalfis(9,out_fis)
ans = 2.0000

'ans' is the output of anfis.

Related Search : Matlab anfis code example,Adaptive Neuro-Fuzzy Inference Systems Matlab code,Anfis matlab examples,Neuro-fuzzy matlab code,Neuro-fuzzyMatlab examples

Thursday, 8 December 2011

Fuzzy Logic Examples using Matlab,Fuzzy Logic Modeling with Matlab,Introduction to Fuzzy Logic using MATLAB

Fuzzy Logic, which used in Artificial intelligence.It contain logical think of rules and member input and output functions. Three steps are taken to generate a fuzzy control engine:
1)Fuzzification(Using membership functions to graphically illustrate a situation)
2)Rule evaluation(purpose of fuzzy rules)
3)Defuzzification(find the crunchy or actual results)

Here we provide the examples of Fuzzy Logic and design it.In below one way you easy create the Fuzzy project using matlab tool.

In Matlab contain a fuzzy Toolbox.it simple to create an Fuzzy Logic.
1.Type fuzzy in matlab command prompt.


2.Add a input and output variables.






in coding as follows

a = newfis('my_fis');
a = addvar(a,'input','service',[0 10]);
a = addmf(a,'input',1,'poor','gaussmf',[1.5 0]);
a = addmf(a,'input',1,'good','gaussmf',[1.5 5]);
a = addmf(a,'input',1,'excellent','gaussmf',[1.5 10]);

3.Set the input variable range and corresponding input membership function ranges,same thing do in output also.



4.choose type of Mf functions.


5.Double click the mamdani for adding a rules.




in coding

ruleList=[1 1 1 1 1
1 2 2 1 1];

a = addrule(a,ruleList);

In ruleList 1st row is 1st rule.in first 3 ones are input range and output range.in 4 is and /or 5 th one is weight of the rule.

6.Finaly save that fuzzy file name on your hard disk.

Testing a Fuzzy

1. Load a my_fis.fis in matlab command window using following commands.

my_fis_mat = readfis('my_fis'); % reading fis file

2.Give the inputs.

If you have two input means give two values in one vector array.
test_data is

my_fis_mat = readfis('my_fis');
my_test = [2 1; 4 9];
out = evalfis(my_test,my_fis_mat)

in out variable contain your result of your fuzzy. Finally you got the answer.

Examples of neural network using matlab | Neural network matlab Code | Neural Network Matlab Example

Neural Network tool is one of the toolbox in matlab.Neural Network operates Artificial intelligence approch. Most research works are used this concept.This concept mostly working in pattern recognition,classification and prediction.We give some notes, how to use neural network in matlab.
Matlab is Research tool ,mainly used for research and researchers.you have use following operations for study the Neural Network.
Neural Network contain Three layers.
  1. Input Layer
  2. Hidden Layer
  3. Output Layer
Use following operation in Matlab for train the data on NeuralNetwork.
  1. Goto matlab command window.
  2. Type nftool (nftool is keyword, for load the Neural network Toolbox on matlab).
  3. Then you sea following screen.


4. Load The data s from work space.


5.Set The hidden layers of neural network.



5.Then goto Next.Then press Train button train your data.


6.Then goto 2 Next Button then press generate m file.This m file is your training file.


This method for directly using Neural Network Toolbox.
In below create Neural network with using NN toolbox codes and syntax's.
  1. Training use as following code
>> input_data = [1 2;2 3;2 2;4 2;6 6]; % Input matrix
>> output_data = [3;5;4;6;12]; %output vector
>> net = newff(input_data',output_data',20); % design a NN Structure
>> net = train(net,input_data',output_data');% Train the data's
2. Test the data's on NN.
>> pred = sim(net,[2;3]) % test the data's on neural network
pred =

4.95

This "sim" is a function ,for test the data's on networks.you may have use large amount of data's to train and test on neural network

Radial basis function Neural network Example | RBF Neural Network code | Matlab example of RBF

In Neural Network one of the type is '(RBF) Radial basis function' network.This neural network is also one of the classifier in research area.More than tools are build this network.RBF network are used in Matlab and Weka tools.In this networks operates radial basis functions , like distance and centers.It easy to compute linear and time series data prediction.This network contain three layers.That layers are
  1. Input Layer
  2. Hidden Layer
  3. Output layer(may be linear)
This network generate random weight to map the Input to output using radial basis function.This weight are hidden neurons.
here we put the example Matlab code of RBF neural network Training and Testing.
Training Process:
>> input = [1 2 3 4 5 6 7 8 9];
>> target = [2.0 4.1 5.9 6.8 7.4 8.4 9.4 10.3 11.9];
>> net = newrb(input,target,20);
NEWRB, neurons = 0, MSE = 8.47802
Testing :
>> test_input = 1.5;
>> Y = sim(net,test_input) % output value in Y.

Y =

3.9
above example giving a linear data we predict in interval of input data.

SVM Train the Data in Matlab | Matlab SVM code for training and Testing | Matlab svm data train and test

In Support Vector machine uses predict the supervised learning data's.In beginning SVM uses two class features only.Now we modifies that algorithm used more class data's in Muti-SVM concept.It supports following type of functions run inside the SVM.
  1. Linear data's
  2. Quadratic data's
  3. Radial Basis Function data's
  4. Multi-layer Perception data's
These above are developed kernel function's.These are predefined develop codes in matlab.In below mention SVM main properties.
  1. Input (Training data's) .
  2. Output(Groups).
  3. Kernel functions.
In svm use more domain's to analyse the datas's and predict the patterns.It used most major domain's like Data-mining,image processing,medical Imaging and ect.Below we give some example code for SVM Example.It use svmtrain and svmclassify function's.
  1. svmtrain for train the data's.
  2. svmclassify for test the data's.
below example contain two classes of 9 data's.
>> data = [1 1;2 1;3 1;4 1;5 2;6 2;7 2;8 2;9 2];
>> data

data =

1 1
2 1
3 1
4 1
5 2
6 2
7 2
8 2
9 2

>> my_svm_struct = svmtrain(data(:,1),data(:,2));
>> out = svmclassify(my_svm_struct,1)

out =

1

>> out = svmclassify(my_svm_struct,1.5)

out =

1

Finally predict the data's using svmclassify function.

How to add toolbox in matlab program | How to set toolboxs in matlab

In matlab contain large amount of toolboxes available on Internet.Toolbox like Packages.it contain amount of method to provide particular operation.Matlab toolboxes are two type.
  1. Predefined
  2. User-defined
Predefined - This toolboxes are inbuilt on matlab.
user-defined - This toolboxes are user to making tool boxes ,aim for particular operational process.
In predefined toolboxes function directly load on matlab.But user defined toolboxes not default loaded.we invoke these toolboxes on matlab.This process is called add-path.In predefined toolboxes to invoke two steps.
  1. Set path using Matlab File Menu option (Manual process).
  2. User set the path using programming command as "addpath()" (using coding).
In below we explain above two notation steps to add path on matlab.
We use mytoolbox as mathematical toolbox.It contain addition, multiplication, division, subtraction functions.
Then we set the path using matlab windows.
  1. Go to File Menu
  2. Choose set-Path.
  3. Then click "AddFolder".
  4. Then choose the toolbox folder then save and close.
Then go-to command prompt the use to call the toolbox functions, then output shows on matlab.Following scree-shot explain above notations.









In below we explain set path on toolbox using add path () function on matlab predefined function.
>> addpath('C:\Documents and Settings\user1\My Documents\Downloads\Armada_v_1_4 (1)\mytoolbox');
>> c = multiplication(10,14)
c =

140

In above we set the path to "mytoolbox".Then call the function as multiplication on that toolbox.
Related Posts Plugin for WordPress, Blogger...