>> x=linspace(0,1,6); >> y=linspace(0,1,5); >> [X,Y]=meshgrid(x,y) X = 0 0.2000 0.4000 0.6000 0.8000 1.0000 0 0.2000 0.4000 0.6000 0.8000 1.0000 0 0.2000 0.4000 0.6000 0.8000 1.0000 0 0.2000 0.4000 0.6000 0.8000 1.0000 0 0.2000 0.4000 0.6000 0.8000 1.0000 Y = 0 0 0 0 0 0 0.2500 0.2500 0.2500 0.2500 0.2500 0.2500 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.7500 0.7500 0.7500 0.7500 0.7500 0.7500 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 >> Xt=X'; >> px=Xt(:)'; >> Yt=Y'; >> py=Yt(:)'; >> plot(px,py,'o') >> p=[px;py]
Thus, at least the p-matrix is easy.
>> lowleftx=...,...; >> pderect([lowleftx,lowrightx,lowrighty,highrighty]) %% Export geometry and boundary >> [p,e,t]=poimesh(g,4) >> pdemesh(p,e,t)The rectangle-info can be obtained from p and t. (Think of the boundary- edge-info.)