how to control the grid size and scale?
56 ビュー (過去 30 日間)
古いコメントを表示
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));
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!