フィルターのクリア

Creating of Basic Shape in Matlab

2 ビュー (過去 30 日間)
Sergey Dukman
Sergey Dukman 2015 年 5 月 17 日
コメント済み: Star Strider 2015 年 5 月 17 日
Hello!
I am trying to create a rectangle as a basic shape. I use these commands:
rect=[3 4 -1 1 1 -1 -0.5 -0.5];
gd=[rect];
ns=char('rect');
sf='rect';
dl = decsg(gd,sf,ns)
But in the end I get the following error message:
Index exceeds matrix dimensions.
What is wrong with my script? I do not fully understand what the following sentences means: "3 through 6 - x-coordinate of edge starting points" and "7 through 10 - y-coordinate of edge starting points"(from MATLAB help desk). Would somebody explain me this?
I want to get a solid geometry. 'decsg' means Decompose Constructive Solid Geometry into minimal regions. I follow this example http://se.mathworks.com/help/pde/ug/create-geometry-at-the-command-line.html but cannot get a shape.
Sergey

採用された回答

Star Strider
Star Strider 2015 年 5 月 17 日
編集済み: Star Strider 2015 年 5 月 17 日
I don’t have much recent experience with the PDE Toolbox, but your ‘rect’ assignment is missing the last two y-coordinates for your rectangle:
rect=[3 4 -1 1 1 -1 -0.5 -0.5 # #];
where the ‘#’ indicate the missing coordinates.
In the documentation for Create CSG Geometry at the Command Line, the ‘3 through 6’ and ‘7 through 10’ refers to the vector needing four x (in elements 3-6) and four y (in elements 7-10) coordinates to define the rectangle’s corners.
EDIT — The error, ‘Index exceeds matrix dimensions.’ means that the relevant PDE routine is looking for the last two elements in your ‘rect’ vector and can’t find them.
  2 件のコメント
Sergey Dukman
Sergey Dukman 2015 年 5 月 17 日
Hello!
Thank you, Sir.
now it is understandable. I will try all over again.
Sergey
Star Strider
Star Strider 2015 年 5 月 17 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by