フィルターのクリア

how to control the grid size and scale?

56 ビュー (過去 30 日間)
taetae
taetae 2024 年 8 月 5 日 2:54
回答済み: Rahul Chowdhury 2024 年 8 月 5 日 5:57
I had a grid size of 200 * 200, but I wanted to increase the resolution, so I changed it to 400 * 400. Of course, 1 grid square means 1m.
However, when I increased the size to 400, I found out that there were some structural problems in subsequent calculations.
So I want to maintain the grid size at 200 * 200, but adjust the scale so that one square means 0.5m,
and there are no problems in subsequent calculations.
Below is the current code.
originalnewGridSize = 200;
newGridSize = 400;
[x, y] = meshgrid(linspace(1, originalnewGridSize, newGridSize), linspace(1, originalnewGridSize, newGridSize));
  1 件のコメント
Matt J
Matt J 2024 年 8 月 5 日 2:58
Is there a question implied by your post?

サインインしてコメントする。

採用された回答

Rahul Chowdhury
Rahul Chowdhury 2024 年 8 月 5 日 5:57
I don't fully understand what your question is, but I can provide some ideas for you:
The first step would be to understand how the linspace command works. Quickly stated, linspace(x1, x2, n) returns a vector that starts at x1 and ends at x2 with n number of points. You can find the spacing between the points with the formula (x2-x1)/(n-1). Assuming you want to start at 1, end at 200 and have a spacing of 0.5, it should look like this:
linspace(1, 200, 399)
Another thing you could try is looking at the scaledMesh documentation to see if it's applicable for you.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by