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: Raghu Charan A
Subject: Re: parse error when accessing meshgrid elements
Date: Tue, 24 Jun 2014 16:30:54 +0530

nope still the same error pointing at the dot after  xx  is shown
parse error near line 38 of file C:\Octave\Octave-3.8.1\TUNNELING\tunnelallignment.m

  syntax error

>>> z=(vloss/(sqrt(2*pi)*k* getz(xx.))). * exp(-yy.^2/(2* (k*getz(xx.))^2));
                                                  ^


On Tue, Jun 24, 2014 at 4:28 PM, Tatsuro MATSUOKA <address@hidden> wrote:
----- Original Message -----

> From: rcharan51 
> To: help-octave
> Cc:
> Date: 2014/6/24, Tue 19:32
> Subject: parse error when accessing meshgrid elements
>
>t his is my code
>
> x=chain(1,1): chain(55,1);
> y=-50:50;
> [xx,yy]=meshgrid(x,y);
> dia=str2num(input('enter the diameter of the shield \n',
> 's'));
> vol=pi*.25*dia^2;
> percnt=str2num(input('enter the volume loss in percentage \n',
> 's'));
> vloss=vol*percnt/100;
> k=str2num(input('enter the value of k \n', 's'));
> z=(vloss/(sqrt(2*pi)*k* getz(xx.))) * exp(-yy.^2/(2* (k*getz(xx.))^2));
> surf(x,y,z)
>
>
> this is the function getz()
> function [retval] = getz (input1)
> retval=0;
> global chain;
> for n=1:10;
>     j=11-n;
>     if input1>=chain(j, 1);
>       retval=chain(j, 7);
>       break;
>     endif
>   endfor
> endfunction
>
>
>
> when i tried to compile the first code i am getting following error
>
> parse error near line 38 of file
> C:\Octave\Octave-3.8.1\TUNNELING\tunnelallignment.m
>
>   syntax error
>
>>>>  zz=(vloss/(sqrt(2*pi)*k*getz(xx.))) * exp(-yy.^2/(2* (k*getz(xx.))^2));
>                                     ^
> please tell me what am i doing wrong


(vloss/(sqrt(2*pi)*k*getz(xx.))) is a matrix

exp(-yy.^2/(2* (k*getz(xx.))^2)) is a matrix


So the product should be element wise.

(vloss/(sqrt(2*pi)*k*getz(xx.))) . * exp(-yy.^2/(2* (k*getz(xx.))^2));


a dot (.) is missing before '*'.

However I did not test it so that the above is correct.



--

Yours sincerely,

Raghu Charan A,
Third year undergraduate, School of Infrastructure,
Indian Institute of Technology (IIT) Bhubaneswar, India
Email:
 address@hidden ,address@hidden
Mobile No: +91 7205733924




Disclaimer: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
reply via email to

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