help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parse error when accessing meshgrid elements


From: Tatsuro MATSUOKA
Subject: Re: parse error when accessing meshgrid elements
Date: Wed, 25 Jun 2014 20:01:47 +0900 (JST)




----- Original Message -----
> From: rcharan51 
> To: help-octave> Cc: 
> Date: 2014/6/25, Wed 18:52
> Subject: Re: parse error when accessing meshgrid elements
> 
> i succesfully applied function getz to matrix xx by using arrayfun by issuing
> this command
> 
> dd=arrayfun(@getz, xx);
> 
> i am getting an error when using the dd array in an expression to calculate
> the z axes coordinates
> 
>>>  z=-(vloss/(sqrt(2*pi)*k*dd)).* exp(-yy.^2/(2* (k*(dd)).^2));
> error: operator /: nonconformant arguments (op1 is 1x1, op2 is 101x55)
> 
> but this expression worked fine when 'dd' is replaced with 
> 'getz(xx)' i
> think its becoz getz(xx) acted as a scalar
> btu dd is an array with same size as yy and xx
> 
The error message tells you there is a flaw during '/' operation.

What the octave does return in using the following: 

>> vloss/(sqrt(2*pi)*k*dd)

>> vloss./(sqrt(2*pi)*k*dd)

>> -yy.^2/(2* (k*(dd)).^2)

>> (-yy.^2)./(2* (k*(dd)).^2)

Tatsuro



reply via email to

[Prev in Thread] Current Thread [Next in Thread]