Dividing Bounding box into equal parts

조회 수: 10 (최근 30일)
Shweta Saboo
Shweta Saboo 2020년 3월 18일
답변: Prabhan Purwar 2020년 3월 24일
I have a bounding box of dimensions [x y width height]. I want to divide this rectangle into 16 equal rectangles or squares of equal dimensions.
  댓글 수: 1
darova
darova 2020년 3월 18일
What difficulties do you have? What is the question?

댓글을 달려면 로그인하십시오.

답변 (1개)

Prabhan Purwar
Prabhan Purwar 2020년 3월 24일
Hi,
Following code may help:
clc
close all
clear
% bounding box [x y width height]
%Assuming (x,y) represents a starting point located at the bottom left corner of the box (In XY Plane).
x=0;
y=0;
width=16;
height=16;
subparts=16; %No of equal parts (Must be a perfect square)
n=sqrt(subparts)+1;
xb=linspace(x,x+width,n);
yb=linspace(y,y+height,n);
[X,Y]=meshgrid(xb,yb);
surf(X,Y,zeros(n))
Output:
For further information refer to the following links:

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by