|
"MOOON MOOON" wrote in message <ja7pk9$6pk$1@newscl01ah.mathworks.com>...
> Hello,
> I have a matrix m by n and I want to use it in some
> Neural Networks applications.
> For example,
>
> A = [ 24 22 35 40 30 ; 32 42 47 45 39 ; 14 1 10 5 9 ; 2 8 4 1 8] ;
>
> I want to train randomly some columns and test the other remaining columns.
> For example, I want to train randomly 3 of the total columns length
> and test the other remaining columns. So, the first matrix will contain three random
> distinct columns taken from the original matrix A, while the second matrix contains
> the remaining two columns.
> How can I extract these data ?
> Thanks
- - - - - - - - -
t = 3; % Number to be trained
n = size(A,2);
p = randperm(n);
B1 = A(:,sort(p(1:t))); % Train set
B2 = A(:,sort(p(t+1:n))); % Test set
Roger Stafford
|