|
From: | Doug Stewart |
Subject: | Re: parse error when accessing meshgrid elements |
Date: | Tue, 24 Jun 2014 06:50:42 -0400 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |