grid in matlab ? please !

I want to create a uniform grid and place all nodes in a neat and evenly spaced so the rows and columns please

1 件のコメント

Cedric
Cedric 2013 年 10 月 21 日
You'll have to make an example involving a few nodes, because what you want to achieve is not clear.

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

回答 (2 件)

Image Analyst
Image Analyst 2013 年 10 月 20 日

0 投票

myGrid = ones(10);
How about that?

12 件のコメント

Image Analyst
Image Analyst 2013 年 10 月 21 日
Two hours with no response - I guess it wasn't that urgent!
Image Analyst
Image Analyst 2013 年 10 月 21 日
mouihbi's "Answer" moved to a comment here:
thanx but I want a grid with these parameters (width, height, number of square ...) and place nodes of ordered and regularly spaced manner on the rows and columns
Image Analyst
Image Analyst 2013 年 10 月 21 日
mouihbi chaker
mouihbi chaker 2013 年 10 月 21 日
thanx
Cedric
Cedric 2013 年 10 月 21 日
Also
doc meshgrid
doc ndgrid
mouihbi chaker
mouihbi chaker 2013 年 10 月 21 日
thank you Can you help me to place nodes (points) in an orderly manner and regularly spaced rows and columns oubien in each square of the grid
Image Analyst
Image Analyst 2013 年 10 月 21 日
Define what you mean by nodes and grid. Do you mean an rectangular array like an image, or a linked list, or something else. If you mean like graphs/networks, then I haven't worked with those in MATLAB. If you mean just a regular 2D numerical array then maybe I can help.
mouihbi chaker
mouihbi chaker 2013 年 10 月 21 日
table that contains for example 9 square and I want to place for example 4 points on the extremity of each square ( example position with the first square the position of the point are (0.0) (0.1) (1.0) (1.1)) and 4 points in each square (randomly without position). thanx
Image Analyst
Image Analyst 2013 年 10 月 21 日
編集済み: Image Analyst 2013 年 10 月 21 日
myGrid = zeros(9);
myGrid(1,1) = 1;
myGrid(end,1) = 1;
myGrid(1,end) = 1;
myGrid(end,end) = 1;
Walter Roberson
Walter Roberson 2013 年 10 月 21 日
編集済み: Walter Roberson 2013 年 10 月 21 日
You cannot index an array with an index of 0.
xcoords = [0 0 1 1 rand rand rand rand];
ycoords = [0 1 0 1 rand rand rand rand];
scatter(xcoords, ycoords);
Also
[xcoords, ycoords] = ndgrid(0:9, 0:9);
scatter(xcoords(:), ycoords(:));
hold on
[xcoords, ycoords] = ndrigd(0:8, 0:8);
xcoords = xcoords + rand(9, 9);
ycoords = ycoords + rand(9, 9);
scatter(xcoords(:), ycoords(:));
mouihbi chaker
mouihbi chaker 2013 年 10 月 25 日
I want to place 4 nodes in each square ?! thanx
Image Analyst
Image Analyst 2013 年 10 月 27 日
We're getting nowhere because you haven't sufficiently described what you want. Please give an explicit description of what you want, and I'm not talking about some 10 word sentence. I'm asking for a complete paragraph or two, complete with a screenshot, diagram, figure, web page link, or whatever illustrates what you want. Only then can we continue and stop this unproductive back and forth messaging.

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

mouihbi chaker
mouihbi chaker 2013 年 10 月 25 日

0 投票

I want to place 4 nodes in each square ?! thanx

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

タグ

質問済み:

2013 年 10 月 20 日

コメント済み:

2013 年 10 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by