|
From: Bookie via MathKB.com on 7 May 2008 15:21 Forgot some dots! Do I need to put a dot by my division sign? Bookie wrote: >Sorry here's what I have now that's still not compiling: > >% Left out comments and variable declarations, see earlier posting of code >x = a + (ix-1)*(b-a)/(m-1); % a <= x <= b >midXpt1 = c; >% circle1 <= ya <= circle2 >ya = (sqrt(r1^2-(((x>=a)&(x<c))-X1).^2)-Y1) + (iy-1).*(-1*sqrt(r2^2-((((x>=a)& >(x<c))-X2).^2)+Y2)-(sqrt(r1^2-(((x>=a)&(x<c))-X1).^2)-Y1))/(n-1); >% m*x+b <= yb <= circle2 >yb = (m.*((x>=c)&(x<=b))+b) + (iy-1).*((-1*sqrt(r2^2-(((x>=c)&(x<=b))-X2).^2) >+Y2)-(m.*((x>=c)&(x<=b))+b))/(n-1); > >y = ya + yb; >for i = 1:n > for j = 1:m > [T(:,i,j)] = Function(x(i,j),y(i,j)); > end >end >figure >Z = squeeze(T(1,:,:)); >surf(x,y,real(Z)) >axis tight %want x & y axes tight so curves in x-y plane are not skewed >colormap hsv >colorbar > >>Thanks Roger, Walter & Steven. I see what you mean. So I've now fixed how >>I'm using my relational operators but I'm still not getting x and y inputs >[quoted text clipped - 11 lines] >>> >>>Roger Stafford -- Message posted via MathKB.com http://www.mathkb.com/Uwe/Forums.aspx/matlab/200805/1
From: Bookie via MathKB.com on 7 May 2008 15:22
% Left out comments and variable declarations, see earlier posting of code x = a + (ix-1)*(b-a)/(m-1); % a <= x <= b midXpt1 = c; % circle1 <= ya <= circle2 ya = (sqrt(r1^2-(((x>=a)&(x<c))-X1).^2)-Y1) + (iy-1).*(-1*sqrt(r2^2-((((x>=a) & (x<c))-X2).^2)+Y2)-(sqrt(r1^2-(((x>=a)&(x<c))-X1).^2)-Y1))/(n-1); % m*x+b <= yb <= circle2 yb = (m.*((x>=c)&(x<=b))+b) + (iy-1).*((-1*sqrt(r2^2-(((x>=c)&(x<=b))-X2).^2) +Y2)-(m.*((x>=c)&(x<=b))+b))/(n-1); y = ya + yb; for i = 1:n for j = 1:m [T(:,i,j)] = Function(x(i,j),y(i,j)); end end figure Z = squeeze(T(1,:,:)); surf(x,y,real(Z)) axis tight %want x & y axes tight so curves in x-y plane are not skewed colormap hsv colorbar Bookie wrote: >Forgot some dots! Do I need to put a dot by my division sign? > >>Sorry here's what I have now that's still not compiling: >> >[quoted text clipped - 26 lines] >>>> >>>>Roger Stafford -- Message posted via MathKB.com http://www.mathkb.com/Uwe/Forums.aspx/matlab/200805/1 |