On Wed, Nov 16, 2011 at 8:08 AM, George Kousiouris

<

[hidden email]> wrote:

>

> hi,

>

> in matrix multiplication the inner dimensions must be identical. thus when

> you multiply an AxB matrix with a CxD one, you must have that B=C. and the

> result is a AxD matrix

>

> BR,

> George

>

>

> On 11/15/2011 10:50 PM, Tomi Piriyev wrote:

>

> hi,

> "

> if sigmoid(theta'*x) >= 0.5, p =1

> else p=0

> "

> i tried to use this code, , but compiler gets "error: operator *:

> nonconformant arguments (op1 is 1x3, op2 is 100x3)"

> could you help me

>

>

> _______________________________________________

> Help-octave mailing list

>

[hidden email]
>

https://mailman.cae.wisc.edu/listinfo/help-octave>

>

> --

>

>

>

> _______________________________________________

> Help-octave mailing list

>

[hidden email]
>

https://mailman.cae.wisc.edu/listinfo/help-octave>

>

Note that if the result of sigmoid is a matrix as well, you should put

p to one in the right places. That is

X = theta*x.';

[n m] = size(X);

p = false(n,m);

ind = sigmoid(X) >= 0.5;

p(ind) = true;

--

M. Sc. Juan Pablo Carbajal

-----

PhD Student

University of Zürich

http://ailab.ifi.uzh.ch/carbajal/_______________________________________________

Help-octave mailing list

[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave