|Subject:||Re: multiplying variables|
|Date:||Wed, 3 Feb 2010 10:16:58 +0530|
you need to use .* instead of just *
as p is vector and log2 ( p ) is also a vector
and when we do individual element by
element operation one needs to put a .
preceeding the operator.
I need to plot a graph of a function
H(p) = p log2 (p)
So in matlab i wrote it as
p = (0.1:0.1:1.0)
h = p * log2 (p)
But this gives the error
error: operator *: nonconformant arguments (op1 is 1x10, op2 is 1x10)
error: evaluating binary operator `*' near line 3, column 6
error: evaluating assignment _expression_ near line 3, column 3
How can i express h ?
Thanks & Regards
Amrita University '10
Help-octave mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|