Hi Jawad,
I think this might do the trick:
targets = [zeros(1,2000) ones(1,2000)];
targets_1 = targets == 0;
targets_2 = targets == 1;
targets_1 and targets_2 will be "logical"; if you want double:
targets_1 = double(targets == 0);
targets_2 = double(targets == 1);
Good luck!
Claudio
"Jawad " <jawadhasan80@gmail.com> wrote in message <j9pmka$48q$1@newscl01ah.mathworks.com>...
> I have one matrix called targets (1X4000); column 1 to 2000 contains double value 0 and column 2001 to 4000 contains double value 1
>
> a)
> i want to create a matrix called targets_1 where i want to check if the value is 0 then make the entry 1 so at the end of the day i must have a matrix with :column 1 to 2000 with value 1 and column 2001:4000 with value zero
>
> b)
> Same situation as above but this time i want to check if the value is 1 then make the entry 1 and if it is zero then make the entry zero; at the end; my new matrix targets_2 contains values: column 1 to 2000 with value zero and column 2001:4000 with value 1
>
> i know how to use the strcmp function to make such checking with strings, but problem is that my original matrix is double and i dont know if there is such function like
>
> setosaCmp = strcmp('setosa',species);
>
> which could work with double (numbers); any help would be appreciated
