f



How to measure accuracy in matlab?

Hello all,

I just want to ask a question as I am new to matlab

when I finished training the network, I want to measure network accuracy by comparing the target class and testing result (i used sim function), how can i do it?


Thanks a lot
0
dinaezzat (3)
9/14/2011 8:55:28 PM
comp.soft-sys.matlab 211264 articles. 26 followers. lunamoonmoon (257) is leader. Post Follow

7 Replies
2723 Views

Similar Articles

[PageSpeed] 29

"Dina " <dinaezzat@gmail.com> wrote in message <j4r4c0$a5i$1@newscl01ah.mathworks.com>...
> Hello all,
> 
> I just want to ask a question as I am new to matlab
> 
> when I finished training the network, I want to measure network accuracy by comparing the target class and testing result (i used sim function), how can i do it?
> 
> 
> Thanks a lot
Hi Dina, 

Try using Support Vector machine(SVM) to get the accuracy. 
0
9/14/2011 9:37:27 PM
On Sep 14, 4:55=A0pm, "Dina " <dinaez...@gmail.com> wrote:
> Hello all,
>
> I just want to ask a question as I am new to matlab
>
> when I finished training the network, I want to measure network accuracy =
by comparing the target class and testing result (i used sim function), how=
 can i do it?
>
> Thanks a lot

More details are needed.

How many classes?
Did you use separate trn/val/tst sets?
How many input/output-target pairs per class for each set?
What did you use for training targets ...
(ideal input-conditional posterior probabilities ?)
Do prior probabilities and misclassification costs have to be
considered?
Do you need confusion matrices?
Do you need error threshold operating curves?

Hope this helps

Greg
0
heath (3983)
9/18/2011 11:08:05 AM
Thanks a lot for your reply.
Actually, I have 10 classes indicating 10 users.
For each user (class): I have for example 10 instances for training and 5 instances for testing.
The idea is that I want to find a way to compare the performance or accuracy of neural networks when 2 different kinds of data are used for the ten users.
Also, I need to know after training the network, how I do the testing on the 5 instances.

This is a sample of code:
mnma=minmax(P);
net=newff(mnma,[2 4],{'tansig','purelin'});
save net;
net=train(net,P,T);
y = sim(net,P);

Greg Heath <heath@alumni.brown.edu> wrote in message <77357532-c871-410c-8dc2-789ce003ae9d@j8g2000yqa.googlegroups.com>...
> On Sep 14, 4:55 pm, "Dina " <dinaez...@gmail.com> wrote:
> > Hello all,
> >
> > I just want to ask a question as I am new to matlab
> >
> > when I finished training the network, I want to measure network accuracy by comparing the target class and testing result (i used sim function), how can i do it?
> >
> > Thanks a lot
> 
> More details are needed.
> 
> How many classes?
> Did you use separate trn/val/tst sets?
> How many input/output-target pairs per class for each set?
> What did you use for training targets ...
> (ideal input-conditional posterior probabilities ?)
> Do prior probabilities and misclassification costs have to be
> considered?
> Do you need confusion matrices?
> Do you need error threshold operating curves?
> 
> Hope this helps
> 
> Greg
0
dinaezzat (3)
9/18/2011 2:36:10 PM
CORRECTED FOR THE HEINOUS SIN OF TOP-POSTING !

On Sep 18, 10:36 am, "Dina " <dinaez...@gmail.com> wrote:
> Greg Heath <he...@alumni.brown.edu> wrote in message <77357532-c871-410c-8dc2-789ce003a...@j8g2000yqa.googlegroups.com>...
> > On Sep 14, 4:55 pm, "Dina " <dinaez...@gmail.com> wrote:
> > > Hello all,
>
> > > I just want to ask a question as I am new to matlab
>
> > > when I finished training the network, I want to measure network accuracy by comparing the target class and testing result (i used sim function), how can i do it?
>
> > > Thanks a lot
>
> > More details are needed.
>
> > How many classes?
> > Did you use separate trn/val/tst sets?
> > How many input/output-target pairs per class for each set?
> > What did you use for training targets ...
> > (ideal input-conditional posterior probabilities ?)
> > Do prior probabilities and misclassification costs have to be
> > considered?
> > Do you need confusion matrices?
> > Do you need error threshold operating curves?
>
> Thanks a lot for your reply.
> Actually, I have 10 classes indicating 10 users.
> For each user (class): I have for example 10 instances for training
> and 5 instances for testing.
> The idea is that I want to find a way to compare the performance or
> accuracy of neural networks when 2 different kinds of data are used
> for the ten users.
> Also, I need to know after training the network, how I do the testing
>on the 5 instances.
>
> This is a sample of code:
> mnma=minmax(P);
> net=newff(mnma,[2 4],{'tansig','purelin'});
> save net;
> net=train(net,P,T);
> y = sim(net,P);

1. Please do not top-post!
2. Please try to answer ALL previous questions that I ask.
3. A 10/5 trn/test split within f-fold cross-validation ( with f=3)
   will  increase the confidence of your results. f-fold XVAL
    with f = 5 and a 12/3 trn/tst split may even be better.
4. T should consist of columns from a c-dimensional (c=10)
    unit matrix with class indices indicated by the row index
    of  the "1"s.
5. Standardize training inputs to have zero means and unit
    variances.
6. Normalize testing inputs with the means and standard
    deviations of the training set.
7. For reference, design
    a. a naive classifier with a constant output and obtain the
        reference mean-square-error MSE00
    b. a linear classifier with MSE = MSE0 and biased R^2
        statistic R20 = 1-MSE0/MSE00
 8. Neural network design
     Determine the number of hidden nodes, H by trial and
      error for 1 <= H <= Hub where Hub is the highest value
      H can have without causing the number of unknown
     weights Nw = (I+1)*H+(H+1)*c to exceed the number of
     training equations Neq = Ntrn*c.
 9. Design f*Nh*Ntrials classifiers where Nh is the number of
     candidate values for H and Ntrials is the number of weight
     initialization trials for each candidate value of H.
10. For each H candidate tabulate trn and tst error rate statistics.
11. Search for my posted examples using search words

      heath close clear newff Ntrials

12. Pseudo code modifications for your no-loop f/Nh/Ntrials = 1/1/1
      code posted above

      NOTE: Data Partitioning,Standardization and Normalization
                   codes  omitted.

      state0     = 4151941  % Initialize rand for random initial
weights
      rand('state',state0)
      c              = 10                          % No. classes
      MSE00    = var(Ttrn(:))            % Reference MSE
      MSEgoal = 0.01*MSE00        % ==> R^2 >= 0.99

     net = newff(minmax(Ptrn),[H c],{'tansig','logsig'});
     or
     net = newff(minmax(Ptrn),[H c],{'tansig','softmax'});

     net.trainParam.goal   =  MSEgoal;
     net.trainParam.show  =  10;
     net = train(Ptrn,Ttrn);

     ytst       = sim(net,Ptst,Ttst);
     MSEtst = mse(Ttst-ytst);
     R2tst    = 1- MSEtst/MSE00

Hope this helps.

Greg

0
heath (3983)
9/18/2011 8:02:40 PM
Greg Heath <heath@alumni.brown.edu> wrote in message <90e63b13-0f4c-455c-92f3-a162cdc7413e@z18g2000yqb.googlegroups.com>...
> 
> CORRECTED FOR THE HEINOUS SIN OF TOP-POSTING !
> 
> On Sep 18, 10:36 am, "Dina " <dinaez...@gmail.com> wrote:
> > Greg Heath <he...@alumni.brown.edu> wrote in message <77357532-c871-410c-8dc2-789ce003a...@j8g2000yqa.googlegroups.com>...
> > > On Sep 14, 4:55 pm, "Dina " <dinaez...@gmail.com> wrote:
> > > > Hello all,
> >
> > > > I just want to ask a question as I am new to matlab
> >
> > > > when I finished training the network, I want to measure network accuracy by comparing the target class and testing result (i used sim function), how can i do it?
> >
> > > > Thanks a lot
> >
> > > More details are needed.
> >
> > > How many classes?
> > > Did you use separate trn/val/tst sets?
> > > How many input/output-target pairs per class for each set?
> > > What did you use for training targets ...
> > > (ideal input-conditional posterior probabilities ?)
> > > Do prior probabilities and misclassification costs have to be
> > > considered?
> > > Do you need confusion matrices?
> > > Do you need error threshold operating curves?
> >
> > Thanks a lot for your reply.
> > Actually, I have 10 classes indicating 10 users.
> > For each user (class): I have for example 10 instances for training
> > and 5 instances for testing.
> > The idea is that I want to find a way to compare the performance or
> > accuracy of neural networks when 2 different kinds of data are used
> > for the ten users.
> > Also, I need to know after training the network, how I do the testing
> >on the 5 instances.
> >
> > This is a sample of code:
> > mnma=minmax(P);
> > net=newff(mnma,[2 4],{'tansig','purelin'});
> > save net;
> > net=train(net,P,T);
> > y = sim(net,P);
> 
> 1. Please do not top-post!
> 2. Please try to answer ALL previous questions that I ask.
> 3. A 10/5 trn/test split within f-fold cross-validation ( with f=3)
>    will  increase the confidence of your results. f-fold XVAL
>     with f = 5 and a 12/3 trn/tst split may even be better.
> 4. T should consist of columns from a c-dimensional (c=10)
>     unit matrix with class indices indicated by the row index
>     of  the "1"s.
> 5. Standardize training inputs to have zero means and unit
>     variances.
> 6. Normalize testing inputs with the means and standard
>     deviations of the training set.
> 7. For reference, design
>     a. a naive classifier with a constant output and obtain the
>         reference mean-square-error MSE00
>     b. a linear classifier with MSE = MSE0 and biased R^2
>         statistic R20 = 1-MSE0/MSE00
>  8. Neural network design
>      Determine the number of hidden nodes, H by trial and
>       error for 1 <= H <= Hub where Hub is the highest value
>       H can have without causing the number of unknown
>      weights Nw = (I+1)*H+(H+1)*c to exceed the number of
>      training equations Neq = Ntrn*c.
>  9. Design f*Nh*Ntrials classifiers where Nh is the number of
>      candidate values for H and Ntrials is the number of weight
>      initialization trials for each candidate value of H.
> 10. For each H candidate tabulate trn and tst error rate statistics.
> 11. Search for my posted examples using search words
> 
>       heath close clear newff Ntrials
> 
> 12. Pseudo code modifications for your no-loop f/Nh/Ntrials = 1/1/1
>       code posted above
> 
>       NOTE: Data Partitioning,Standardization and Normalization
>                    codes  omitted.
> 
>       state0     = 4151941  % Initialize rand for random initial
> weights
>       rand('state',state0)
>       c              = 10                          % No. classes
>       MSE00    = var(Ttrn(:))            % Reference MSE
>       MSEgoal = 0.01*MSE00        % ==> R^2 >= 0.99
> 
>      net = newff(minmax(Ptrn),[H c],{'tansig','logsig'});
>      or
>      net = newff(minmax(Ptrn),[H c],{'tansig','softmax'});
> 
>      net.trainParam.goal   =  MSEgoal;
>      net.trainParam.show  =  10;
>      net = train(Ptrn,Ttrn);
> 
>      ytst       = sim(net,Ptst,Ttst);
>      MSEtst = mse(Ttst-ytst);
>      R2tst    = 1- MSEtst/MSE00
> 
> Hope this helps.
> 
> Greg





Thanks a lot for your reply.

I am sorry for not answering the questions but the problem is that I did not understand some of them because I am new to neural networks and matlab.

I just need to use neural networks to compare between 2 kinds of data to show which yields better results.

So I will show you now the whole code I used for only 4 classes to better understand me and help me if possible:

%Class1
A1=[12324022 4524008 4992008 9828018  9672017 3900007 3120005 4680008 4524008 156000 5460010 8892016  10608018 3276006 3276006 3900007 18252032 6084010 7020012  10920020 11700020 5304009 4680008 5460010 -1404002 -1404002 3432006 7800014 8580015 1872004 1716003 3120005 57884103];
A2=[1800003  4020006 4212008 7800014  7176012 2964005 3900007 3588006 4056007 156000 4212008 6864012  8112014  2652005 3744006 3744007 7224012  5580009 5772011  8424015  8736015  4212008 4992009 4836009 -1368002 -1404003 2652005 6240011 6552011 1404002 2652004 2496004 39612070];
A3=[2600003  3448005 3744007 7488013  4992009 2808005 3900007 3900007 3496006 468000 3900007 6708012  5460010  2808005 3432006 4368007 7296011  5164008 5616010  8580015  6552012  4368008 4992009 5460009 -1200002 -1248003 2028004 5616010 3900007 1248002 2340004 2808005 38600066];
A4=[2496005  3432006 3432006 6552011  6240011 3744007 3120005 3900007 3588006 156001 3588006 5928010  7020013  3120005 2964005 3900007 7332013  4992009 5148009  7644013  8112015  4992009 4212007 4992009 -1248002 -1404002 1872003 4836008 5148009 1872003 1872003 2808005 36660065];
A5=[3120006  2964005 4836008 6396012  5148009 2964005 3120005 5928011 3120005 624001 4524008 5772010  5460010  2964005 3276006 5928010 7488013  4992008 6552011  7488013  6552011  4368007 4680008 7488013 -1248002 -1404002 2808005 4680009 4056008 1560003 1716003 4368008 39540070];
A6=[3900007  3588006 3276006 4368008  4836008 2184004 3120005 3276006 3744006 156001 3744006 3432006  5148009  2496005 2808005 3588006 8736015  4992009 5148009  5304009  6084010  3744007 4368008 4836009 -1092002 -1248002 1872003 2496005 3900007 936002  1560002 2028003 32332058];
A7=[2496005  3744006 3276006 6240011  5148009 3120005 3900007 4680008 4212008 0      3588006 5616010  5460009  3276006 3588006 4836009 7644014  5148009 4992009  7332013  6552011  4680008 5148009 6084011 -936001  -1404003 1872003 4524008 4056007 1716003 2340004 3432006 37992068];
A8=[2340004  4212008 8424015 11076019 8736015 2652005 2964005 4992009 4836009 780001 7956014 10452018 8424015  2808005 2964005 5148009 8268015  6708012 10452018 12480021 9828017  3900007 4212007 6396011 -1092002 -1716003 5928011 9048016 7332013 1560003 1716003 3744007 49816089];
A9=[5304009  3900007 3120005 4680009  4368007 2340004 2808005 3276006 4212008 0      3276005 4056007  4836009  1872003 2808005 3588007 10764019 5460010 4836008  5772010  5928010  3432006 3900007 4680009 -1248002 -1560003 1560002 2964006 3276006 780001  1716003 2184004 34660065];
A10=[2964005 5928011 8580015 5460009  4992009 2340004 3120006 3900006 5928010 780002 8112014 4524008  5772010  2184004 2808005 4056007 10452018 8268015 10452018 6396011  6708012  3900007 4368008 5304009 -1560003 -1560002 6240011 3588006 4056007 624001  1560003 2652004 43520077];

%Class2
B1=[2028004  8268014 16380029 5460010  14352025 3432006  11076019 6084011  8112014 4056007 12480022 5460010 14352025 4056007 10452019 6084010 10920019 12948022 17160030 6240011 15132026 4836008  11856021 6864012  -780001 -624001  11700021 4680009 13572024 2652005 9672017  5304009 73164129];
B2=[3120005  5460010 11388020 7644013  10764019 3276006  9360016  4368008  5928011 2340004 9516017  7488013 10296018 4212007 8892016  3744006 9672017  8892016  12948023 9048016 11700021 5148009  10764019 5148009  -624001 -1092002 7956014  6084010 9360016  2340004 7488013  2964005 61508113];
B3=[2964005  9828018 12636022 7800014  9516016  4680008  7332013  3900007  9828018 1560002 11856021 7176013 9360016  5616010 7176013  3276006 13416024 12012021 14040024 8580015 10140017 6240011  8736016  4680009  -624001 -624001  10452019 6396012 8736015  4056007 5772010  2496004 64272113];
B4=[2000003  2912004 2808005  5460010  2964005  2964005  3120006  4056007  2860005 312000  2496005  5616009 3120006  2652005 3120005  4056007 6160010  4472007  4056008  6864012 4524008  4212008  4368008  5304009 -1300002 -1248003 1248002  4212007 1560003  1404002 1872003  2808005 30268053];
B5=[3800005  4724008 5928011  4524007  4212008  2184004  6396011  3900007  4680008 780002  5616010  3744006 4524008  2496004 6084011  4056007 9772015  6752012  7644014  5460009 5460010  3744006  7644013  5304009 -1292002 -1248002 3900007  2808004 3276006  936002  4836009  2652005 39040068];
B6=[3120005  5928011 10608018 2808005  4992009  2808005  5304009  3744007  6084011 1404002 9828018  2184004 4992008  3588007 5148009  2964005 9828017  8112014  12012021 3588007 5772010  4368008  6708012  4368008 -624001 -780001   8424015  1404002 4212007  2028004 3744006  2340004 44836080];
B7=[3036005  8268014 12792023 4836008  7176013  3120005  7332013  4836009  8268014 1092002 12480022 4212008 7176012  3900007 6864012  4368008 11928020 9984017  14196025 5616010 7956014  4680008  8424015  5460010 -624001 -624001   11076020 3432006 6396011  2340004 5772010  3744007 58300103];
B8=[2100003  5168009 11700020 2340004  7020013  4524008  7176012  7956014  5248009 1248002 11232020 1560003 7176012  5304010 6708012  7488013 8048013  7196012  13260023 3120006 7956014  6240011  8424015  8736016 -700001 -780001   9672017  780001  6240011  3588007 5460009  6708011 53720094];
B9=[1800003  3784006 8112014  2808005  5616010  3432006  4836008  2652005  3864006 936002  7644013  2340004 5616010  4212008 4680008  2028003 6364010  5500009  9360016  3588006 6396011  4992009  6240011  3432006 -700001 -780001   6396011  1560003 4836009  2652005 3276005  1248002 38364067];
B10=[4524008 4524008 15132027 3744006  4836009  3588006  5460010  3900007  4524008 2184004 14040025 2808005 5148009  4056007 5304009  3588006 9516017  7176013  16692030 4368008 5772011  4992009  6708012  4836008 -468001 -468001   12480022 2184003 4212007  2652004 4056007  2652005 51332092];

%Class3
C1=[2808005  8736016  12168021 7020012  94692167 1560003  2808004  4992009  8736015 1872003  10764019 6552012  94848166 1716003  2808005  4680008  12168022 11232020 13260023 7644014  95472168 2496004  3744006  5616010  -624002  -624001  9672017  5928010  94068165 780002  1872003  4056007  148220262];
C2=[3588006  6240011  13104023 9048016  9672017  3588006  2964006  4992008  6552011 2028004  11076019 8736015  9828018  3588006  3276006  4368007  10920019 9360017  14196025 9828017  10608019 4524008  4212008  5616009  -780002  -1092002 9984017  7956014  8892016  2652004 2028004  3744006  60124106];
C3=[6240011  5304010  17784031 8268014  9204017  1872003  2808005  3900007  5616010 6708012  11232020 7956014  9360016  2028004  2808005  3588006  12480022 12948023 18876033 9048016  10140018 2964005  3900007  4680008  -624001  -936001  10140018 7176012  8424015  936002  1716003  2808005  62244110];
C4=[10296018 8424015  10452018 6552012  11700020 2808005  3120006  4056007  8736015 1716003  8736016  6396011  11856021 2964005  3276006  3588006  19656034 11076019 11388020 7332013  12636022 3900007  4368008  4836008  -624001  -936001  7800014  5616010  10920019 1872003 2028004  2808005  65536116];
C5=[6396011  5304009  8112015  6552011  36816065 2028003  2652005  4056007  5304010 936001   7332013  6240011  37128065 2340004  2496005  3588006  12480022 7020012  9048016  7176012  37752066 3276005  3744007  4680008  -780001  -780002  6396012  5616010  36192064 1092002 1404003  2964005  77752137];
C6=[5772011  7020012  26988047 4524008  14352026 2340004  3588006  4056007  7332013 1092002  26208046 4056007  14508026 2496004  3744007  3588006  13572024 8892015  28080049 5148009  15132027 3276005  4680008  4680008  -468000  -780001  25116044 3432006  13728025 1560003 2652005  2964005  75036132];
C7=[2652004  9516017  7488013  5304010  9360016  1716003  4836008  5148009  9516016 1404003  6552011  4680009  9360016  2340004  4524008  4836009  12948022 11700021 8736015  5928011  9984017  2964005  5772010  5772011  -780002  -780001  5304009  4056008  8736015  1092002 3588006  4212007  62556110];
C8=[3788007  5616010  8112014  6552012  19812034 2028004  8892016  5460009  5928011 1404002  6708012  6084011  19656034 2496005  8892015  5148009  10496019 8112014  9204016  7176013  20280035 2964006  9828017  6084010  -780001  -1092002 5616010  5460010  19188033 1560003 7956014  4524008  69640124];
C9=[3744007  7488013  9516017  6708012  8736015  1872003  2808005  4056007  7956014 1404003  8112014  6240011  8736015  2028004  3120005  3588006  12324022 9984018  10608019 7332013  9360016  2652005  3900007  4680008  -624001  -1092002 7020012  5616010  8112014  1248002 2028003  2964005  51020091];
C10=[3120005 4680008  42432075 15600027 5772010  2340004  9672017  5304010  4992009 2340004  39936070 15444027 5928011  3120005  9048016  4992009  8736015  7956014  43212076 16224028 6552012  3900007  10608019 5928011  -624001  -936002  39156069 14820026 5148009  1560002 8112014  4368008  94692166];

%Class4
D1=[2340004  6240011  13572024 1560002  8112015  1560002  5772010  1560003  5928011  2028003  11856021 1404002 8112015  1872003 5616010  1404002 9048016  8736015  14352025 2184003  8736016  2496004  6552012  2184004  -780001  -468001  11076020 780001  7488014  936001  4836008  780001 58440103];
D2=[9516016  14508026 24804043 2652005  9828017  2184004  8580015  1716003  14508026 10920019 14196025 2652005 9672017  2340004 8268014  1716003 24648043 26052046 25740045 3588007  10608019 3120006  9204016  2340004  -624001  -624001  13260023 1716003 8892015  1404002 7644013  1092002 83304146];
D3=[4368008  9204016  24492043 2028004  11232019 2340004  7332013  1560003  9204016  3276006  21528038 1560002 11700021 2652005 6708011  1716003 14196025 13104023 25428045 2496004  12168021 3588007  7956014  2340004  -624001  -624001  20592036 1092002 10764019 1404002 6084010  936002  72228127];
D4=[1872003  20436036 12324022 2028003  11700021 2184004  6864012  1248002  20592037 1872003  10452018 2184004 11544020 2340005 6864012  1248002 23088041 23088041 13104023 2964005  12480022 3120006  7800014  2184004  -624001  -780002  9672017  1248002 10764019 1404003 5928010  312000  69752124];
D5=[5148009  10452018 20280036 1872003  11388020 1560003  10764019 1092001  10296018 2340004  18096032 1872003 11388020 1716003 10608019 1092002 16068028 13260023 20904037 2496004  12012021 2340004  11388020 1716003  -624001  -468001  17472031 1248002 10764019 936002  9984018  468000  72636128];
D6=[7956014  9204016  12324021 1248003  12480021 1404003  6864012  2808005  9516016  1560003  10452018 1404003 12636022 1716003 5772010  3588007 18096031 11700020 12948022 2028004  13416023 2652005  7020012  3744007  -624001  -936001  9828017  624002  11700020 468001  5616010  2652005 63824113];
D7=[7800014  2652005  24804043 1560003  7800014  1872003  5928010  1560003  2340004  936002   23712042 1560002 7956014  2028004 5616010  1404002 11388020 4524008  25584045 2340004  8736015  2964005  6708012  2184004  -1248002 -936001  22932040 780001  7020013  936002  4836008  780001  63044112];
D8=[6708011  1872004  14820026 2652004  9828018  1404002  5460010  2340004  1560003  1404003  13884024 2028003 10140018 1560003 5304009  2184004 9360016  4056008  16068028 3276005  10764019 2496004  6396011  3120005  -1092002 -780001  12636022 1404002 9204017  468001  4368008  1404003 54152096];
D9=[4000005  1504003  18096032 1560003  9828017  1716003  5616010  1092002  780001   312001   17784031 1560003 9984017  2028004 5460009  936002  6128009  2440005  18720033 2184004  10608018 2808005  6552011  1872003  -1348003 -624001  17160030 936002  9204016  936002  4524008  156001  55544097];
D10=[6588011 7488013  18252032 2028003  11700021 1560003  5304009  2028004  7020012  1404002  17004030 1872004 11700020 2028004 5304009  1560003 14700025 9516016  19032033 2652005  12324022 2652005  6396011  2652005  -1092002 -624001  16224029 1248002 11076019 936002  4212007  936002  65088113];



P=[A1' A2' A3' A4' A5' A6' A7' A8' A9' A10' B1' B2' B3' B4' B5' B6' B7' B8' B9' B10' C1' C2' C3' C4' C5' C6' C7' C8' C9' C10' D1' D2' D3' D4' D5' D6' D7' D8' D9' D10'];  



T=[1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 
   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1;
  
  ];



mnma=minmax(P);
net=newff(mnma,[2 4],{'tansig','purelin'});
net=train(net,P,T);
save net;


%Testing Data

A11=[2400003 3168005 3432006 9204016  3900007 3432006 3432006 3120005 3072005 0      3744007 8892015  4212008  3120005 2964006 3588006 6972010  4572007 5148009  10608018 5616010  4836008 4368008 4524008 -1500002 -1404002 2028004 7488013 2496005 1716003 2028004 2184003 36504063];
A12=[2700004 3192005 3120005 6084011  3120005 3120006 2964005 3900007 3296005 468001 2808005 5616010  3276006  3120005 2808005 4212007 7296011  5064008 4680008  7176013  4368008  4368008 4056007 5304009 -1300002 -1404002 1248002 4524008 2028003 1872003 1716003 2808005 32740056];
A13=[1900003 2900004 3420006 6240011  3744006 4212008 3432006 3744006 3292005 156000 3120006 6396011  3900007  4212007 2964005 4212008 6192009  4448006 4668008  7644013  5304009  5772010 4524007 5304009 -1000001 -1392002 1872004 4992009 2340004 2652005 1872004 2652005 33908058];
A14=[2500003 2980005 3120005 5616010  2652005 4992009 2964005 3588006 3240006 156000 2496004 5928011  3120005  4368008 2808005 3900007 7040011  4696008 4212007  7020013  4524008  6240011 4056007 4992009 -1300002 -1560003 1404002 4524008 1248002 3120006 1716003 2496004 31784055];
A15=[2964005 4368008 3276006 4680008  4212008 1872003 2964005 3900007 4836009 780001 2808005 3900007  4680008  1716003 2964005 4212008 8736016  6552012 4992009  5616010  5616010  3120005 4212007 5460010 -936002  -1404003 1092002 2964005 3276006 468001  1716003 2652005 31888062];

B11=[1500002 4048006 8736015  3744007  7956014  4212007  5772010  6240011  4228006 936002  8580015  2964005 8424015  4524008 5616010  5460009 6328009  5764009  10296018 4524008 9204016  5772010  7176013  6864012 -600001 -780001   7020012  2184004 7176013  2964005 4212007  4836008 48392089];
B12=[0       3060005 8580015  2808005  9360016  2808005  4992009  2496004  3684006 1872003 7644014  2184004 9516016  3276006 5148009  1716003 3684006  5556009  10140018 3744007 10452018 4368008  6708012  3432006 0       -624001   6084011  1248002 8424014  1716003 3432006  780001  41408073];
B13=[2500004 3572005 14664026 5616010  6084011  2652004  4368008  8112014  3652006 780001  14664026 4836008 6240011  2964005 4524008  7488013 6852011  5132008  16224029 6396011 7020012  3900006  5772010  8892015 -700001 -780002   13104023 4056007 5304010  1716003 3120006  6708012 53504094];
B14=[2000003 4060006 10920020 2184003  7332013  2496005  4212007  3744007  4140007 1092002 10608018 1560003 7176013  3120005 4212008  2964005 6840011  5932010  12480022 3120005 8112015  3900007  5616010  4368008 -700001 -780002   9048016  624001  6396011  1716003 2808005  2340004 43060075];
B15=[3120006 4836008 11544020 2808005  4992009  3276006  4992008  2652005  4836008 1248002 11232020 2028004 5148009  3900006 5148010  1872003 8580015  6708011  13104023 3588007 5928011  4836008  6708012  3588007 -624001 -624001   9672017  1248002 4212007  2340004 3432006  936001  45480081];


       
C11=[5616010 5148009  14508025 6240011  7956014  2184004  3900007  4836008  4992009 1560003  13104023 6084010  7956014  2808005  3744007  4212007  11388020 7332013  15288027 6864012  8580015  3432006  4992009  5304009  -780001  -624001  12324021 5460009  7332013  1560003 2652005  3744006  65620125];
C12=[3432006 4212007  57720102 2808005  5616010  7644013  12636022 2808005  4368008 1560002  56940100 2028004  5460010  8268014  12324022 2652004  8424015  6552011  59280104 3588006  6240011  8892015  13572024 3588006  -624001  -780002  55380098 1248003  4836009  7020012 11388020 1872003  106920191];
C13=[5616010 4056007  5460009  4524008  15912028 1560003  3120006  4836008  4212007 1248002  4680009  4368007  15600028 1872003  2964005  4524008  10452018 6084010  6708012  5616010  16692030 2652005  4056007  5460009  -624001  -780001  3432006  3276005  14820026 780001  2028004  3900007  56824101];
C14=[2964005 4992009  3900007  7644013  9984018  1560003  2652004  3432006  4992009 1092001  3276006  7176013  9828017  2184004  2808005  2652005  8736016  6864012  5148009  8424015  10608019 2808005  4056007  4056008  -780002  -780002  2028004  6396011  9204016  936002  1404002  2028003  43120077];
C15=[3408006 4680008  50232089 8424014  75504133 1404002  2808005  4368008  4836009 1872003  48360085 8112014  75660133 1716003  2808005  4056007  9024016  7488013  51168090 9048015  76284134 2496004  3900007  5148009  -780001  -936002  47424084 7488013  74880132 624001  1716003  3276006  161612285];


D11=[2808005 4524008  17316030 1716003  8736015  1872004  5928010  1248002  4368008  1716003  16692029 312001  9360016  1872003 5616010  1404003 7956014  6864012  19032033 2028004  9672017  2808005  6552011  2028004  -780001  -624001  14976026 0       8424014  936002  4992009  624001  56004098];
D12=[1560003 9828017  9048016  2028004  8112014  1872003  8580015  1716003  9828017  936002   8424015  1716003 8268014  2184004 8112014  1560003 12012021 11388020 9984018  2652005  8892015  2964005  9204016  2184004  -624001  -624001  7488013  1092002 7488013  1092002 7488013  1092002 51680096];
D13=[2184004 7644013  14664026 1248002  8112014  2340004  6396011  2184004  7644013  1560003  12948023 1404002 8268015  2496004 5928011  2184003 10608018 9984017  15288027 2028003  9048016  3432006  7020013  2808005  -780001  -780001  12324022 624001  7332013  1404002 5304009  1560002 54564097];
D14=[5616010 1560002  18252032 1560003  10608019 1404002  6084011  1560003  1092002  624001   17628031 1404002 10764019 1716003 5616010  1560003 7956014  2964005  19032034 2184004  11388020 2496004  6708012  2184004  -1248002 -780002  16848029 780001  9984018  624001  4992009  936002  57876101];
D15=[5616010 1716003  16848029 1872004  11700020 1248002  3900007  2028004  936002   0        17004030 1404002 12168021 1560003 3744007  1716003 7956014  2340004  17628031 2184004  12480021 2340004  4836009  2652005  -1404002 -624001  16224028 1092002 11388020 468001  2808005  1092002 54912096];



So sorry for being long.
0
dinaezzat (3)
9/19/2011 11:34:10 AM
On Sep 19, 7:34 am, "Dina " <dinaez...@gmail.com> wrote:
> Greg Heath <he...@alumni.brown.edu> wrote in message <90e63b13-0f4c-455c-92f3-a162cdc74...@z18g2000yqb.googlegroups.com>...
>
> > CORRECTED FOR THE HEINOUS SIN OF TOP-POSTING !
>
> > On Sep 18, 10:36 am, "Dina " <dinaez...@gmail.com> wrote:
> > > Greg Heath <he...@alumni.brown.edu> wrote in message <77357532-c871-410c-8dc2-789ce003a...@j8g2000yqa.googlegroups.com>...
> > > > On Sep 14, 4:55 pm, "Dina " <dinaez...@gmail.com> wrote:
> > > > > Hello all,
>
> > > > > I just want to ask a question as I am new to matlab
>
> > > > > when I finished training the network, I want to measure network accuracy by comparing the target class and testing result (i used sim function), how can i do it?
>
> > > > > Thanks a lot
>
> > > > More details are needed.
>
> > > > How many classes?
> > > > Did you use separate trn/val/tst sets?
> > > > How many input/output-target pairs per class for each set?
> > > > What did you use for training targets ...
> > > > (ideal input-conditional posterior probabilities ?)
> > > > Do prior probabilities and misclassification costs have to be
> > > > considered?
> > > > Do you need confusion matrices?
> > > > Do you need error threshold operating curves?
>
> > > Thanks a lot for your reply.
> > > Actually, I have 10 classes indicating 10 users.
> > > For each user (class): I have for example 10 instances for training
> > > and 5 instances for testing.
> > > The idea is that I want to find a way to compare the performance or
> > > accuracy of neural networks when 2 different kinds of data are used
> > > for the ten users.

OK. by 2 kinds you mean training and testing.

> > > Also, I need to know after training the network, how I do the testing
> > >on the 5 instances.
>
> > > This is a sample of code:
> > > mnma=minmax(P);
> > > net=newff(mnma,[2 4],{'tansig','purelin'});

Why didn't you normalize P?
Take a good look at the order of magnitudes in your data.
How do you justify H = 2?

> > > save net;

Save it where? Under what name?
Use the following commands to check the documentation.

 help save
 doc save

> > > net=train(net,P,T);
> > > y = sim(net,P);

Now compute training set MSE and percent error rate
to obtain a highly biased estimate of the ability of the
net on test data.

Next, obtain the same measures of performance for the
test set and compare.

> > 1. Please do not top-post!
> > 2. Please try to answer ALL previous questions that I ask.
> > 3. A 10/5 trn/test split within f-fold cross-validation ( with f=3)
> >    will  increase the confidence of your results. f-fold XVAL
> >     with f = 5 and a 12/3 trn/tst split may even be better.
> > 4. T should consist of columns from a c-dimensional (c=10)
> >     unit matrix with class indices indicated by the row index
> >     of  the "1"s.
> > 5. Standardize training inputs to have zero means and unit
> >     variances.
> > 6. Normalize testing inputs with the means and standard
> >     deviations of the training set.
> > 7. For reference, design
> >     a. a naive classifier with a constant output and obtain the
> >         reference mean-square-error MSE00
> >     b. a linear classifier with MSE = MSE0 and biased R^2
> >         statistic R20 = 1-MSE0/MSE00
> >  8. Neural network design
> >      Determine the number of hidden nodes, H by trial and
> >       error for 1 <= H <= Hub where Hub is the highest value
> >       H can have without causing the number of unknown
> >      weights Nw = (I+1)*H+(H+1)*c to exceed the number of
> >      training equations Neq = Ntrn*c.
> >  9. Design f*Nh*Ntrials classifiers where Nh is the number of
> >      candidate values for H and Ntrials is the number of weight
> >      initialization trials for each candidate value of H.
> > 10. For each H candidate tabulate trn and tst error rate statistics.
> > 11. Search for my posted examples using search words
>
> >       heath close clear newff Ntrials
>
> > 12. Pseudo code modifications for your no-loop f/Nh/Ntrials = 1/1/1
> >       code posted above
>
> >       NOTE: Data Partitioning,Standardization and Normalization
> >                    codes  omitted.
>
> >       state0     = 4151941  % Initialize rand for random initial
> > weights
> >       rand('state',state0)
> >       c              = 10                          % No. classes
> >       MSE00    = var(Ttrn(:))            % Reference MSE

            Correction

            MSE00 = mean( var(Ttrn')')

> >       MSEgoal = 0.01*MSE00        % ==> R^2 >= 0.99
>
> >      net = newff(minmax(Ptrn),[H c],{'tansig','logsig'});
> >      or
> >      net = newff(minmax(Ptrn),[H c],{'tansig','softmax'});
>
> >      net.trainParam.goal   =  MSEgoal;
> >      net.trainParam.show  =  10;
> >      net = train(Ptrn,Ttrn);
>
> >      ytst       = sim(net,Ptst,Ttst);
> >      MSEtst = mse(Ttst-ytst);
> >      R2tst    = 1- MSEtst/MSE00
>
> > Hope this helps.
>
> > Greg
>
> Thanks a lot for your reply.
>
> I am sorry for not answering the questions but the problem is
> that I did not understand some of them because I am new to
> neural networks and matlab.

That is not a good excuse. I get very offended when there is no
response to a question I ask from someone who wants free help.

> I just need to use neural networks to compare between 2 kinds
> of data to show which yields better results.

No. That is not what you need. What you need is a classifier
designed with training and validation data and tested with
nondesign test data to obtain an unbiased estimate of performance
on unseen data that can be considered to come from the same
probability distribution as the training, validation and test data..

Your lack of nontraining validation data only leaves training
set performance to compare with test set performance.
These comparisons may not be very useful because the
training set error estimates tend to be highly biased.

That is why i suggested f-fold crossvalidation and/or a
validation set.

> So I will show you now the whole code I used for only 4
> classes to better understand me and help me if possible:

Thanks, but no thanks. What I would like to see is

1. How you interpreted my reply.
2. How you implemented my reply.
3. The results of 2. In particular,
    a. Training and test MSE and classification error rates.
    b. Any error messages

-------SNIP

> P=[A1' A2' A3' A4' A5' A6' A7' A8' A9' A10' B1' B2' B3' B4' B5' B6' B7' B8' B9' B10' C1' C2' C3' C4' C5' C6' C7' C8' C9' C10' D1' D2' D3' D4' D5' D6' D7' D8' D9' D10'];

> T=[1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
>    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
>    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
>    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1;
>
>   ];

UHOH!

size(P) = [ 33 40]
but
size(T) = [ 4 55]

The number of columns must be the same.

> mnma=minmax(P);
> net=newff(mnma,[2 4],{'tansig','purelin'});

For 4 classes H   <= floor(40*4/(33+1+4))       =  4
For 10 classes H <= floor(100*10/(33+1+10)) = 22

> net=train(net,P,T);
> save net;

You apparently ignored the code I sent.

NOTE: The 4 means of the above classes lie in a
3-dimensional space. Therefore, for 4 classes, you
might not need  many of the 33 input variables.

Hope this helps.

Greg

P.S. At this point consider the following too advanced
        to worry about:

        input variable reduction
        prior probabilities
        misclassification costs
        confusion matrices
        threshold operating curves
0
heath (3983)
9/20/2011 3:59:13 AM
On Sep 19, 11:59=A0pm, Greg Heath <he...@alumni.brown.edu> wrote:
> On Sep 19, 7:34 am, "Dina " <dinaez...@gmail.com> wrote:
> > Greg Heath <he...@alumni.brown.edu> wrote in message <90e63b13-0f4c-455=
c-92f3-a162cdc74...@z18g2000yqb.googlegroups.com>...

_____SNIP

> size(P) =3D [ 33 40]

What are the 33 variables?
facial features?

Greg
0
heath (3983)
9/20/2011 4:33:25 AM
Reply:

Similar Artilces:

Matlab engine with matlab R2010b
Hello All, I'm working with an aplication that use the matlab engine. I made the C++ program and it is working well in my pc with matlab 2007b, but the same very basic program shows an error when I tried to compile it in a pc with matlab R2010b. The error is about the icuuc32.dll. ¿Why is asking this DLL? How can I solve this?. Thanks¡ ...

Contribute to MATLAB Central and Win a MATLAB Jacket
Many of you who post to this newsgroup are also regular contributors to the MATLAB Central File Exchange. Look for your favorite contributors on our File Exchange Author Profile page. You can read their profiles and see pictures: <http://www.mathworks.com/matlabcentral/reports/fileexchange/allProfiles/> In a random drawing, we recently awarded MATLAB jackets to three File Exchange authors with profile pages: Michele Giugliano, Andrey Egin, and Denis Gilbert. You can win a jacket, too. Just submit a new file to the File Exchange or update your author profile by December 2003 for a chance to win one of four MATLAB jackets. See the jacket below: <http://www.mathworks.com/matlabcentral/images/jeff3.jpg> Here are some interesting File Exchange facts: - Since its inception in 2001, visitors have downloaded more than 1.25 million submissions from the File Exchange. - In September 2003 alone, visitors downloaded 80,085 files, an average of 2670 a day! .... what if the prize was a free copy of the next version of Matlab :-) majb Min Poh wrote: ....or an offer for employment... aj "bourassa" <bourassa-m@rmc.ca> wrote in message news:3f9d507d$1@rmcnt03a.rmc.ca... > ... what if the prize was a free copy of the next version of Matlab :-) > > majb > > Min Poh wrote: > ...

Why does Matlab do this
What is happening when I type rand(1:10) at the command line? Matlab goes into a 10 minute spin - what's going on? Thanks "Robert" wrote in message <j64asi$5v4$1@newscl01ah.mathworks.com>... > What is happening when I type > rand(1:10) > at the command line? > > Matlab goes into a 10 minute spin - what's going on? > Thanks Hi Robert, You're create a 10-D array with that syntax. Do you just want a vector of 10 uniformly distributed random numbers. x = rand(10,1); % or x = rand(1,10); Wayne Hi Wayne, You're right - that's what I was trying to do... but I was just newbie mucking about trying to work out the syntax and I typed that in - then had a looong wait for Matlab to work through it! Thanks for the explanation. Robert "Robert" wrote in message <j64d2h$dvo$1@newscl01ah.mathworks.com>... > Hi Wayne, > You're right - that's what I was trying to do... but I was just newbie mucking about trying to work out the syntax and I typed that in - then had a looong wait for Matlab to work through it! > Thanks for the explanation. > Robert That's fine. Welcome to MATLAB!!! If that's the worst memory-intensive mistake you ever make, you'll be fine :) I've done much, much worse. Wayne ...

Matlab parallel for loop or Matlab open pool
I am trying to to some computations and I would like to do it in parallel using parfor or by Opening the matlabpool.. as the current implementations is too slow: result=zeros(25,16000); for i = 1:length(vector1) % length is 25 for j = 1:length(vector2) % length is 16000 temp1 = vector1(i); temp2 = vector2(j); t1 = load(matfiles1(temp1).name) %load image1 from matfile1 t2 = load(matfiles2(temp2).name) % load image2 from matfile2 result(i,j)=t1.*t2 end end It work fine but I would really like to know if there is a way to speed thing up ... Thanks a lot in advance! ...

Call Matlab m-file from Matlab Scrip Node
My problem with matlab script node is related to calling function in matlab.&nbsp; I created an m-file function that takes an imput temperature (from DAQ) and defines a material property.&nbsp; My matlab script node doesn't seem to recognize my function.&nbsp; I have placed the function in the folder the vi is currently located, but it doesn't read it.&nbsp; How do I get matlab script node to read the functions I create in matlab? Add the directory to matlab path, or call the .m file with it full name ( D:\..... \myfile.m) Let me clarify, &nbsp; I have pasted my matlab code into the matlab scrip node. &nbsp; In this code, I have called a subfunction that I have created. &nbsp; Example k(n)=k_c(T(n)) where k_c is a subfunction I have created. &nbsp; How do I get my code in the node&nbsp;to sucessfully read the subfunction k_c? &nbsp; &nbsp; &nbsp; As indicated, you need to add the directory where the .m file containing the function resides to the list of paths that are read in. This is your startup.m file. The other option is to do a "cd" command prior to calling your function to change to the directory where the .m file containing the function resides. Thanks for reiterating the information.&nbsp; My matlab script node is working properly.&nbsp; I had never used the "cd" command in matlab.&nbsp; I always set the working directory when I open the program, and put all the m files into t...

Need help for a matlab mini project
Hello everyone, I have a matlab in class exercise due in few days. I am new to matlab and the instructions provided with the assignment is minimal. Can Someone help me with the basic understanding as in how can I map the problem's solution to matlab script ? I am not able to post question here as it is a jpeg file. Please let me know and then we can discuss further. ...

Matlab student license for MDSD (e.g. Matlab Coder)
Hello, I'm evaluating products for writing my final university thesis. I want to perform image processing algorithms (C-Code compiled for a DSP). I have the feeling that manual programming of this algorithms is no longer state of the art. Instead MDSD (model driven software development) - that means Code Generation - seems to be smarter to me. Unfortunately Mathworks offers no licenses of Matlab Coder (or Simulink Coder etc.) to individual students. And I cannot afford to buy a commercial license (which probably would cost me more than 5.000 EUR/$ / my absolute limit is 1.000 EUR/$). Is there any possibility for me to use MDSD (code generation) for image processing for my university thesis ? Maybe by using cheaper alternatives ? Or by using 3d party software (like target link) ? Or export/import to another product ? Any idea ? (I want to avoid manual coding - like using OpenCV) By the way, does anyone know, why Mathworks hides the MDSD features from students ? It doesn't make sense to me that Mathworks reduces the amount of engineers available on the job market that are capable of handling (serious) Matlab projects. (Microsoft offers the "Visual Studio Express Edition" for free for education and the amount of people on the job market that are experienced in Visual Studio is tremendous.). Thank you, Roelof ...

bar
In MatLab 6.5, the routine above works normal: figure; sem=Average(:,2)./sqrt(Average(:,3)); bar([1:1:7],Average(:,1),sem); ylabel('% of epochs analyzed') xlabel('Frequency Band') title ('Occurrence of Oscillatory Events - Ch X') %Where Average and sem are vectors; But, in MatLab 7.0, the same code cause the following error: ??? Error using ==> xychk Too many input arguments. Error in ==> bar at 53 [msg,x,y] = xychk(args{1:nargs},'plot'); Error in ==> cross_subj_analysis>ok_Callback at 327 bar([1:1:7],Average(:,1),sem); I'd like to know why this occour. Thanks Henrique In article <g7a1j6$l1$1@fred.mathworks.com>, Henrique Amaral <henriquetomaz@uol.com.br> wrote: >In MatLab 6.5, the routine above works normal: >figure; >sem=Average(:,2)./sqrt(Average(:,3)); >bar([1:1:7],Average(:,1),sem); >ylabel('% of epochs analyzed') >xlabel('Frequency Band') >title ('Occurrence of Oscillatory Events - Ch X') >%Where Average and sem are vectors; >But, in MatLab 7.0, the same code cause the following error: >??? Error using ==> xychk >Too many input arguments. >Error in ==> bar at 53 > [msg,x,y] = xychk(args{1:nargs},'plot'); >Error in ==> cross_subj_analysis>ok_Callback at 327 >bar([1:1:7],Average(:,1),sem); >I'd like to know why this occour. When the third argument is numeric, it must be the bar width. barwidth must b...

Matlab builder JA: parse java string to matlab cell
Hi all, I'm building a java swing based GUI for my Matlab application. As such, user input is available as text strings, for example "{[0; 0], [3.5 0; 0 2]}" (mean vector and covariance matrix of a 2D Gaussian). The user input will be passed to the compiled matlab method as a MWCellArray. Problem is how do a convert (parse) the above string into a MWCellArray? From its javadoc http://www.mathworks.com/access/helpdesk/help/toolbox/javabuilder/MWArrayAPI/index.html the following method is available: java.lang.String toString() Returns a string representation of this array, but the reverse method is not. Evidently, parsing a string like the one above is a non trivial task and I'm loath to attempt writing one by myself. I would be very thankful if someone can point me to the required parser implementation. Matlab itself is carrying out this task all the time, perhaps it is possible to access Matlab's own parser. Help much appreciated, Ritesh ...

some problems of codes of MATLAB 7.0 working on MATLAB 6.5
I have used MATLAB for few hours.So I don't know the differences between version 6.5 and 7.0.I want to use some codes of MATLAB 7.0, but they doesn't work in MATLAB 6.5.How to change these codes so that they can work in matlab 6.5.Waiting for your help. Thank you . The codes are like this .I think changing the function findPI may work ,but I don'y know how % PIfun.m % Evaluate a function used to find the PI-line, using Kyle Champley's % method. % % Adam Wunderlich % last update: 5/18/06 function y = PIfun(r,R,h,gamma,x3,sb) temp = R - r*cos(gamma-sb); y = h*((pi - 2*atan(r*sin(gamma-sb)/temp))*(1 + (r^2 - R^2)/ (2*R*temp)) ... + sb) - x3; % find_PI_Line.m % % Find the the parametric interval corresponding to the unique PI-line % passing through the point x for a given helical pitch. % This code implements the method of Kyle Champley. % inputs: P = pitch (cm/turn), R = helix radius, delta_s = s stepsize, x % output: PI = [sb st] % % Adam Wunderlich % last update: 5/18/06 function [PI] = findPI(P,R,delta_s,x) h = P/(2*pi); r = sqrt(x(1)^2+x(2)^2); gamma = atan2(x(2),x(1)); options = optimset('TolX',h*delta_s/100,'FunValCheck','on'); [sb,fval,exitflag] = fzero(@(sb) PIfun(r,R,h,gamma,x(3),sb),... [(x(3)-h*pi)/h,x(3)/h],options); if exitflag ~=1, disp('Error: PI invalid'); end % note that beta=sb in Kyle's formula alphaX = atan(r*sin(gamma-sb)/(R - r*cos(gamma-sb))); st = sb + pi -...

can't run matlab setup/No puedo correr matlab
Hi! I opened the&nbsp;matlab script fractal.vi&nbsp;then my antivirus (Kaspersky)&nbsp;ask&nbsp;if I acept the modified te registry of matlab setup,&nbsp; I &nbsp;say "yes" After that when I want open matlab the setup run but inmediatly it's close, why???? &nbsp; Hola: Abri el matlab script fractal.vi y mi antivirus (Kasoersky)me preguntaba si aceptaba una modificacion del registro del setup de matlab yo acepte Despues de eso cuanto abro matlab se cierra inmediatamente porque?? &nbsp; &nbsp; &nbsp; Hola Sa�l Es probable que el problema est� relacionado con el antivirus Kaspersky, trata de deshabilitarlo y correr nuevamente el ejemplo.&nbsp; Si esto no funciona revisa el estado de tus licencias de LabVIEW y de Matlab, probablemente tengas que reinstalar el programa y/o activar las licencias. �Qu� versi�n de LabVIEW y Matlab tienes? �El comportamiento es el mismo con el otro ejemplo?, me refiero al de la siguiente dir: labview\examples\scriptnode\Differential Equation.llb\MATLAB Script - Lorenz Diff Eq.vi Si corres este ejemplo �El antivirus tambi�n te pregunta cambiar lo de los registros?, ser�a bueno contactar a Mathworks para saber c�mo reconfigurar nuevamente los registros de Matlab ...

Soft handoff simulation in matlab #2
Hey all, I am having problem in soft handover implementation with MATLAB please help me out. It is my final dissertation .I am unable to do this. ..pls mail me at nikhilpatel0786@gmail.com Thank you very much... Please helpp "vpmp patel" <mecs@yahoogoups.com> wrote in message news:jkh46d$i9m$1@newscl01ah.mathworks.com... > Hey all, > I am having problem in soft handover implementation with MATLAB > please help me out. It is my final dissertation .I am unable to do > this. Then you need to talk to your dissertation advisor first; if he or she can't give you enough help, post SPECIFIC DETAILS about the problem you're experiencing with your implementation and ask a SPECIFIC question and someone may be able to offer some suggestions. -- Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com ...

Incompatible of MAT file for Matlab 6.5.1 and Matlab 7.0
Hi! I have recently installed Matlab 7.0. I have save my simulation results in .MAT file. However, these MAT files can't be opened using Matlab 6.5.1. I encountered problem as follows: ??? Error using ==> load Unable to read MAT file D:\MATLAB7\work\results.mat File may be corrupt. How can I solve this problem? Thanks. Linda Please see here: <http://tx.technion.ac.il/~perryb/matlab7/mat7.pdf> In short, save again as: The new features and enhancements are described in the "Release notes" of Matlab. A new feature that causes incompatibility with previous versions of Matlab is the new encoding of MAT files. Matlab release 14 writes character and figure data to MAT-files using Unicode encoding by default. Unicode encoded MAT-files are not readable by earlier versions of Matlab. If you intend to load your MAT-files created with Matlab release 14, you must override the Unicode default during the save. You can override the default encoding by using the -v6 switch with save and hgsave: save filename -v6 hgsave filename -v6 Hope it helps Linda wrote: > > > Hi! > > I have recently installed Matlab 7.0. > I have save my simulation results in .MAT file. > However, these MAT files can't be opened using Matlab 6.5.1. > > I encountered problem as follows: > > ??? Error using ==> load > Unable to read MAT file D:\MATLAB7\work\results.mat > > File ma...

Matlab for face recognition
Hi All, I am new to Matlab and C++, but quite well understand Java and C. I am planning to get Face recognition App developed using Matlab. The App will expose web service so that user can use it to find best match. Please can you share your thoughts regarding: 1. Is Matlab right tool for this? Or C++ should be used? 2. Eiegenfaces Algo I checked is most popular. What % of accuracy Matlab + eigenfaces algo can provide? 3. Because it will be a web app so no. of simultaneous hits would be high. In this scenario what would be processing / providing match time assuming I have 1000 images in my database? 4. Can we call Matlab function (that will perform job of finding accurate match) from a jsp or php page? Thanks & Regards, Neon Neon, Please see my comments below: Neon <ashwanim@gmail.com> wrote in message <9ae5ffe5-41ae-486a-a4e6-3a2ed087c3a0@s10g2000prs.googlegroups.com>... > Hi All, > > I am new to Matlab and C++, but quite well understand Java and C. > Good, because MATLAB uses Java directly. > I am planning to get Face recognition App developed using Matlab. The > App will expose web service so that user can use it to find best > match. Please can you share your thoughts regarding: > > 1. Is Matlab right tool for this? Or C++ should be used? Hard to answer your question because depends on the project, different parts can use different languages to achieve say efficiency, scalability, and concurrency...

Measuring the correct SNR for image in matlab
Hello all, I am trying to add noise of 5dB to an image in matlab according to the following steps SNR = 5; Id = double(Io) / 255; v = var(Id(:)) / 10^(SNR/10); I_my_noisy = imnoise(Id, 'gaussian', 0, v); but when I measure the SNR by using the matlab command [peaksnr,snr] = psnr(I_my_noisy, Id) I get SNR equal 10. So, what is the wrong in my code? and why the result differ from my add dB? --------------------------------------- Posted through http://www.DSPRelated.com On 2016-02-16 7:55, bamerni wrote: > Hello all, > > I am trying to add noise of 5dB to an image in matlab according to the > following steps > > SNR = 5; > Id = double(Io) / 255; > v = var(Id(:)) / 10^(SNR/10); > I_my_noisy = imnoise(Id, 'gaussian', 0, v); > > > but when I measure the SNR by using the matlab command > > [peaksnr,snr] = psnr(I_my_noisy, Id) > > I get SNR equal 10. So, what is the wrong in my code? and why the result > differ from my add dB? What do you get if you use SNR3 = 10*log10(var(Id)/var(I_my_noisy-Id)) ? What does psnr return for a simple ideal image with one single pixel "1" (all other 0) and with the noisy image containing 2.7783 ? ...

'Matlab Code' to 'Embedded Matlab fun code'
Dear friends, I have a Matlab code to process a pure analog signal 'u'. Now I want to implement it in Simulink and I want to use it in 'Embedded Matlab fun block' so i need to transform 'Matlab code' to 'Embedded Matlab fun code' to perform the task. The Matlab code is as follows: %%%%%%%%%%%%%%%%%%%%% u_abs = abs(u); major_th = 1.5e-1; minor_th = 1.8e-2; major_peak_value = []; minor_peak_value = []; pos = 1; pos_max = 1; while ~isempty(pos) [m pos_max(end+1)] = max( u_abs( pos : pos + 10) ); pos_max(end) = pos_max(end) + pos - 1; if m > major_th major_peak_value(end+1) = m; else minor_peak_value(end+1) = m; end % exit the peak pos = find(u_abs(pos:end) < minor_th, 1 , 'first') + pos-1; % Find the beginning of the next peak pos = find(u_abs(pos:end) > minor_th, 1 , 'first') + pos-1; end pos_max(2) = []; plot(u); hold on; plot(pos_max,u(pos_max),'ro'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I think i don't need this plot command as I will see the result in the scope directly. Any suggestion will be very useful. Thanking you! Prashant "Prashant Sandhi" wrote in message <jafvj8$soq$1@newscl01ah.mathworks.com>... > Dear friends, > > I have a Matlab code to process a pure analog signal 'u'. Now I want to implement it in Simu...

Recent soft computing papers and MATLAB Toolboxes
Dear Colleagues, I would like to call your kind attention to the updated website of the Soft Computing Research Group at the University of Veszprem (Hungary) http://www.fmt.vein.hu/softcomp/ You can download MATLAB Toolboxes: - Fuzzy Clustering MATLAB Toolbox - Genetic Programming MATLAB Toolbox - Interactive Evolutionary Strategy (EASy) MATLAB Toolbox - Constrained Fuzzy Model Identification for the FMID Toolbox independent MATLAB programs related to: - Data mining * Fuzzy clustering based time-series segmentation * Supervised Fuzzy Clustering for the Identification of Fuzzy Classifiers * Fuzzy Modeling with Multidimensional Membership Functions: Grey-Box Identification and Control Design * Compact TS-Fuzzy Models through Clustering and OLS plus FIS Model Reduction * Inconsistency Analysis of Labeled Data * Star plots - MATLAB files for Graphical Representation of trace elements of clinkers - Process control and monitoring * Feedback Linearizing Control Using Hybrid Neural Networks Identified by Sensitivity Approach * Incorporating Prior Knowledge in Cubic Spline Approximation - Application to the Identification of Reaction Kinetic Models * Identification and Control of Nonlinear Systems Using Fuzzy Hammerstein Models - A Simple Fuzzy Classifier based on manuscripts in PDF about - fuzzy model based process control and monitoring - fuzzy clustering and classification - incorporation of a priori knowledge in the identif...

Recent soft computing papers and MATLAB Toolboxes
Dear Colleagues, I would like to call your kind attention to the updated website of the Soft Computing Research Group at the University of Veszprem (Hungary) http://www.fmt.vein.hu/softcomp/ You can download MATLAB Toolboxes: - Fuzzy Clustering MATLAB Toolbox - Genetic Programming MATLAB Toolbox - Interactive Evolutionary Strategy (EASy) MATLAB Toolbox - Constrained Fuzzy Model Identification for the FMID Toolbox independent MATLAB programs related to: - Data mining * Fuzzy clustering based time-series segmentation * Supervised Fuzzy Clustering for the Identification of Fuzzy Classifiers * Fuzzy Modeling with Multidimensional Membership Functions: Grey-Box Identification and Control Design * Compact TS-Fuzzy Models through Clustering and OLS plus FIS Model Reduction * Inconsistency Analysis of Labeled Data * Star plots - MATLAB files for Graphical Representation of trace elements of clinkers - Process control and monitoring * Feedback Linearizing Control Using Hybrid Neural Networks Identified by Sensitivity Approach * Incorporating Prior Knowledge in Cubic Spline Approximation - Application to the Identification of Reaction Kinetic Models * Identification and Control of Nonlinear Systems Using Fuzzy Hammerstein Models - A Simple Fuzzy Classifier based on manuscripts in PDF about - fuzzy model based process control and monitoring - fuzzy clustering and classification - incorpor...

Why can't Fortran-mex files be compiled on matlab V5.3 and run on matlab V6?
Hi, does anyone know why Fortran-mex files can't be compiled on matlab V5.3 and run on matlab V6? For example: if I compile the example-program (shipped with matlab) timestwo.f on matlab version 5.3 (R11) and try to run it on matlab version 6+ (R12 or R13), I get the error message: "Unable to load mex file: E:\timestwo.dll. The specified module could not be found. ??? Invalid MEX-file" Likewise if I compile it on matlab version 6.1 (R12), I get a similar error message if run on matlab version 5.3 (R11). However, if I run it on matlab version 6.5 it works OK. If I try the same experiment with the corresponding example file written in C, timestwo.c, I get no such problems. Why is that? Per A. Hi Per, usually MEX-files need to be compiled with the MATLAB version you want it later to run with. The reason is, that the code links against the current dynamic libraries (DLLs), which may change from version to version. You may have luck that it works (see your example of timestwo.f), but you should never rely on this. Titus "Per A. Brodtkorb" <Per.Brodtkorb@ffi.no> wrote in message news:eecb303.-1@webx.raydaftYaTP... > Hi, > > does anyone know why Fortran-mex files can't be compiled on matlab > V5.3 and run on matlab V6? > > For example: if I compile the example-program (shipped with matlab) > timestwo.f > on matlab version 5.3 (R11) and try to run > it on matlab version 6+ (R12 or R13), I ...

What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit)
What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit) I’m trying to import historical prices of stock data. Matlab keeps cutting off the header of each column; it gives me only values. I am thinking that this is a data-type-mixing-issue, or whatever it’s called. I have ‘Dates’ in ColumnA, and ‘MSFT’, ‘PWER’, ‘KO’, and ‘SBUX’, in ColumnB-ColumnE. Basically, if I put the Excel file in my Matlab folder and double-click the file, I see the values in a matrix (no dates and no headers), I hit ‘Next’. Then, I see only one option; one radio button is enabled – ‘Create variable matching preview’. The other two options, ‘Create vectors from each column using column names’ and ‘Create vectors from each row using row names’ – both are greyed out. I’ve seen videos, on YouTube and on the Matlab site, where people import excel data and these options are NOT greyed out. No matter what I do, there options are ALWAYS greyed out. The problem is, when I click ‘Finish’ in my ‘Workspace’ I have a variable named ‘data’ all values in a 575x4 matrix, but I have NO DATES and I have NO HEADERS on the columns. All of this seems to go into another variable, called ‘textdata’; all dates and headers ate in textdata. This is VERY inconvenient. I’m trying to analyze some stock data and I have no headers, so I have no idea which stock is which (I can figure it out, but I think Matlab should do this for me). Also, I have no dates corresponding to ...

Shall i use the misrosoft Visual c++ code from a m-file generated from matlab in Visual C++ with out matlab runtime environment
undefined ...

C++ Mex file crashes matlab on 64bit linux, but not 32 bit windows, but program runs fine outside Matlab
Hello, I have written a mex gateway function to a C++ class. If I compile this mex function on 32Bit windows using R2008a I have no problems. If I compile and run on Matlab R2011a running 64bit Scientific Linux (a version of Red Hat Enterprize Linux) matlab exits with a segfault when the mexfunction is called, although it appears to run about halfway through the program. The C++ class can be compiled and run (with a main function) outside of Matlab on both platforms with no errors. I am using Microsoft Visual C++ Express Edition on the windows machine, and gcc 4.4.5 on the Linux machine. Can anyone suggest what the cause of this might be and how I can I fix it? I am having a hard time debugging on Linux as I do not have access to a graphical debugger for use with matlab and am unfamiliar with gdb. This is compounded by the fact that the program compiles and runs fine when compiled as a standalone program. A zip file containing the code and data files necessary to reproduce the problem can be downloaded from http://www.see.ed.ac.uk/~s0237326/downloads/mexcrash.zip. This zip file contains the .m and .cpp source code, and a text file for testing (Temp.fem). The file fmehsersetup.m shows the commands I am using to compile. The file Test_mexfmesher.m runs the mexfunction with an appropriate input for testing. The mex gateway function is mexfmesher.cpp, it calls the fmesher class which is made up of the files in the fmesher directory. Below is a backtrace from the se...

setting outputs in ADEXL usage of measure type-matlab and ocean
please point me to simple examples for this. thanks, yvk On 08/05/12 05:13, yvk wrote: > please point me to simple examples for this. > > thanks, > yvk > it's in the documentation. The Help menus should take you to the documentation, as would cdnshelp from the UNIX command line. Andrew. ...

soft decoding of conv. codes using vitdec matlab func. #2
Hello, Isnt 'unquant' and 'soft' options essentially same?..in both case vitdec takes in "real numbers" as input (ok they are "mapped" in case o 'soft' option)..so can we not use 'unquant' option to carry out sof decoding?...my preliminary results show that 'unquant' option give me 2- db gain over hard decoding... any one having insight please let me know. thanks >Hello, > Isnt 'unquant' and 'soft' options essentially same?..in both cases >vitdec takes in "real numbers" as input (ok they are "mapped" in case of >'soft' option)..so can we not use 'unquant' option to carry out soft >decoding?...my preliminary results show that 'unquant' option give m 2-3 >db gain over hard decoding... >any one having insight please let me know. >thanks > > %%% Yes , u can use 'unquant' as soft decoding. try to implement for k=3 i.e [5 7] and BPSK and at roughly 4 dB u should get BER of 10^-3. Chintan ...

Web resources about - How to measure accuracy in matlab? - comp.soft-sys.matlab

Accuracy International AWM - Wikipedia, the free encyclopedia
1,100 m (1,203 yd) ( .300 Winchester Magnum ) 1,500 m (1,640 yd) ( .338 Lapua Magnum ) The Accuracy International AWM rifle is a variant of the ...

Facebook Improves Page Insights Visualization Accuracy, Adds Date Ranges
Facebook is rolling out an update to the native data visualizations of its Page analytics tool Insights. The accuracy of counts for Page tab ...

Measurements : When is the difference between 99% accuracy and 99.9% accuracy very important?
When it can stop a Zombie Apocalypse. It's 2020, and every movie buff and video gamer's worst fear has become reality. A zombie outbreak, originating ...

WPM - Measure Typing Speed and Accuracy on the App Store on iTunes
Get WPM - Measure Typing Speed and Accuracy on the App Store. See screenshots and ratings, and read customer reviews.

8/28/2006-Peter Schiff Predicts The US Economic Collapse With Unbelievable Accuracy - YouTube
Visit http://www.PhilDeCarolis.com to sign up for my free weekly newsletter that includes Economic and Real Estate updates or for more Peter ...

Accuracy in lab's DNA
Queensland courts can have greater confidence in DNA test results thanks to a new state-of-the-art sample tracking system and a lab upgrade, ...

Jones ordered to be trained in factual accuracy
Jones ordered to be trained in factual accuracy

300: Rise of an Empire review: Film jettisons historical accuracy for sex and violence
With its bronze palate, declamatory acting and rivers of blood, this sequel is dull, nasty and utterly unrealistic.

Cult of Bloomberg way underpinned by accuracy
IN financial news reporting, there is everyone else's way, and then there is the Bloomberg way. In fact, make that The Bloomberg Way, the book. ...

Eagles need goal kicking accuracy
It would concern some West Coast supporters that the Eagles lost to Port Adelaide by 14 points on Saturday night despite having more scoring ...

Resources last updated: 3/30/2016 4:56:01 PM