help-octave
[Top][All Lists]
Advanced

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

parse error when accessing meshgrid elements


From: rcharan51
Subject: parse error when accessing meshgrid elements
Date: Tue, 24 Jun 2014 03:32:24 -0700 (PDT)

this 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



--
View this message in context: 
http://octave.1599824.n4.nabble.com/parse-error-when-accessing-meshgrid-elements-tp4664997.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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