building a non-uniform 2D grid for a specific interval

11 ビュー (過去 30 日間)
checkMAT
checkMAT 2019 年 6 月 24 日
回答済み: Bjorn Gustavsson 2019 年 6 月 24 日
I would like to build a non-uniform grid where I want to have a higher number of rows and columns only for a specific area within my grid. using the following code I can only specify the interval for one coordinate (x or y) at the time:
gx = [1:10,10:0.5:20,20:30];
gy = [1:0.5:10,10:20];
[xq,yq] = meshgrid(gx , gy);
I attached the scatter plot that I got out of it. However I would like to build a grid with a higher number of rows and columns only in the upper central part of my figure, where the 2 'high resolution' stripes overlap each other.

回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2019 年 6 月 24 日
Many of matlab's functions need the input parameters to be on "plaid" grids (pcolor, surf, interp2, etc). That means that in order to have a denser grid in your region-of-interest you will get regions with higer density in one or the other direction also outside your ROI. If you want you can start to work on irregular grids using triangulation-based interpolation and plotting routines. This will give you complete controll over where to have your points - which obviously will give you freedom to adjust point density as you see fit. The interpolation-function (scatteredinterpolant, trisurf, tricont/tricontour - available at the file exchange) are a bit slower/more computationally demanding.

カテゴリ

Help Center および File ExchangeMap Display についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by