How to create a box inside box?
이전 댓글 표시
I am trying to create a large box (Four division) and further divide individual box into four small boxes. I am able to divide the boxes on bottom left and top right portion but not in top left and bottom right portion, can anyone please help me on this. I have attached the MATLAB code and also the image for reference.
Thank you
The code:
clear
clc
nx=3;
ny=3;
x=linspace(0,1,nx);
y=linspace(0,1,ny);
[X,Y]=meshgrid(x,y);
%%%%%%%%%%%%%%%%%%%
x1=linspace(0,1/2,nx);
y1=linspace(0,1/2,ny);
[X1,Y1]=meshgrid(x1,y1);
%%%%%%%%%%%%%%%%%%%
x2=linspace(0,1/4,nx);
y2=linspace(0,1/4,ny);
[X2,Y2]=meshgrid(x2,y2);
%%%%%%%%%%%%%%%%%%%
x3=linspace(1/2,1,nx);
y3=linspace(1/2,1,ny);
[X3,Y3]=meshgrid(x3,y3);
plot(X,Y,'k',Y,X,'k');
hold on
plot(X1,Y1,'k',Y1,X1,'k');
hold on
plot(X2,Y2,'k',Y2,X2,'k');
hold on
plot(X3,Y3,'k',Y3,X3,'k');
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
