フィルターのクリア

Structured array or hierarchy of object creation

2 ビュー (過去 30 日間)
Mounisha Ganesan
Mounisha Ganesan 2019 年 9 月 21 日
コメント済み: Mounisha Ganesan 2019 年 10 月 5 日
I want to create a set of structured arrays like this
I want to have a area element having properties like length and width, area, thickness like
AREA =[];
AREA.length= 2cm;
AREA.width=3cm;
and inside the area I want to have Fibre elements having properties
Fibre =[];
Fibre.length = 1micrometer;
Fibre.dia =0.9 micrometers.
AREA ELEMENT---->> FIBRE----->>Properties. So How should I do this flow of objects or have a subsystem in structures ?
  1 件のコメント
David Hill
David Hill 2019 年 9 月 21 日
I think you should look at classdef, it might be the structure you are looking for.

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

回答 (1 件)

Navya Seelam
Navya Seelam 2019 年 9 月 24 日
Hi,
You can create a structure AREA with one of its fields as structure Fibre as shown below.
AREA.length= 2;
AREA.width=3;
AREA.Fibre.length = 1e-6;
AREA.Fibre.dia =0.9e-6;
  1 件のコメント
Mounisha Ganesan
Mounisha Ganesan 2019 年 10 月 5 日
Thank you. I kind of did it in a similar way.
s= struct('AREA',[],'Fibre',[])
AREA.length =10;
Fibre.width =5

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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by