Home How to plot a rectangular in MATLAB
Reply: 0

How to plot a rectangular in MATLAB

user1065
1#
user1065 Published in August 14, 2018, 8:27 am

It is necessary for me that plot a rectangular in MATLAB by contour. But when I plot this, the figure is like square and no rectangular.

In fact the length of X axis and Y axis are true, but figure is not rectangular.

How could I find a rectangular figure?

Once before I needed to plot a n eliptical by countour and it was like circle, by setting axes([xmin xmax ymin ymax]) this problem was solved but know this command do not work.

Here is my code u0,x,y are 3 vectors of length nx*ny. and nx and ny are the number of points in x axis and y axis.

figure 
for i=1:ny
    z(i,:)=u0((i-1)*nx+1:i*nx);
    x1(i,:)=x((i-1)*nx+1:i*nx);
    y1(i,:)=y((i-1)*nx+1:i*nx);
end;

cMap = [0.45 0.6 0.65;1 1 1]; % [green;yellow] on rgb-color
colormap(cMap);
axis equal
contourf(x1,y1,z,'LineColor','none')
colorbar

Let 's=0:0.1:0.2' and 'x=repmat(s,1,ny)' and 'd=0:0.1:1', 'y=repmat(d,1,nx)' 'u0=x+y'

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.296718 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO