SlideShare a Scribd company logo
1 of 21
TOPIC:- STRUCTURE ARRAYS
Presented by :
 About MATLAB
 Arrays
 Types of arrays
 Structure arrays
 Creating structures
 Structure functions
 Program
 Accessing structure arrays
 Summary
 MATLAB (matrix laboratory) is a fourth-generation high-level
programming language and interactive environment for
numerical computation.
 MATLAB is widely used as a computational tool in science
and engineering encompassing the fields of physics ,
chemistry, math and all engineering streams.
It is a range of applications including:
• Signal processing and communications
• Control systems
• Computational biology
 It is started developing MATLAB in
the late 1970s.
 CLEVE MOLER , the chairman of the
computer science department at the
university of New Mexico .
 Moler and Steve Bangert together
rewrote MATLAB in ‘C’ and founded
Math works in 1984 to continue its
development.
CLEVE MOLER
STEVE BANGERT
 One of the strength of MATLAB is the capability to handle
collections of items , called ARRAYS ,as if they were a single
entity.
 The array-handling feature means that MATLAB programs
can be very short.
 The array is the basic building block in MATLAB.
 Numeric array
 Character array
 Logical array
 Cell array
 Structure array
 Function handle array
 Java array
 Structure arrays are composed of structures.
 Numeric, character and cell arrays all reference the individual
elements by number.
 Structures reference individual elements within each row
(called “fields”) by name.
 To access these fields, the dot “.” notation is used.
 Assignment is as follows:
Structurename.Fieldname = datatype;
 Let’s create a simple structure:
>>Person . first name = ‘ramesh’;
Person .Last name = ‘ babu ’;
Person.Address1 = ‘china’;
Person . city = ‘america’;
Person . state = ‘US’;
Person . Zip = ‘30332-0001
 >>person=
first name: ’Ramesh’
last name: ’Babu’
address1:’china’
city : ‘America’
state : ‘US’
Zip: ‘30332-0001’
By creating simple structure then type in command window
person that will display above result i.e is related to
person details . Person(1) also gives same information.
 s= struct(‘f1’,’v1’,’f2’,’v2’,...)
creates a structure array with the fields ‘f1’,’f2’,…
having the values ‘v1’,’v2’,...
Ex:
>>s= struct(‘type’,{‘big’,’little’},’color’,’red’,’x’,{3 4})
s=1x2 struct array with the fields:
type
color
x
.
.
 names=fieldnames(s)
Return the fields names associated with the
structure array S as names , a cell array of strings.
Ex: >>names=fieldnames(s)
names=‘type’
‘color’
‘x’
 isfield(s,’field’)
returns 1 if ‘field’ is the name of a field in the
structure array s and 0 otherwise.
Ex: >>isfield(s,’field’)
ans=0
>>isfield(s,{‘type’,’color’,’x’})
ans=1 1 1
 isstruct(s)
Returns 1 if the array s is a structure array and 0
otherwise
Ex: >>isstruct(s)
ans=1
 s=rmfield(s,’field’)
removes the field ‘field’ from the structure
array s
 Ex: >>s=rmfield(s,’type’)
s=1x2 struct array with fields:
color
x
These are the structure functions and there
descriptions.
 c=structure2cell(s)
converts structure array to cell array.
Ex: >>clear s, s.category=‘tree’;s.height=37.4;
s.name=‘bamboo’;
>>c=struct2cell(s)
c= ‘tree’
[37.4000]
‘bamboo’
>>f=fieldnames(s)
f=‘category’
‘height’
‘name’
 s=cell2struct(c,fields,dim)
converts cell array to structure array.
Here dim means dimensions . c means cell array.
Ex: >>c={‘tree’,37.4,’bamboo’};
f={‘catgeory’,’height’,’name’};
s=cell2struct(c,f,2)
s=
category : ’tree’
height : 37.4000
name : ‘bamboo’
Student . Name . first = ‘kusu’;
student.name . last = ‘kalyan’;
Student . score = 82.39;
Student . grade = ‘B’;
student(2).name . first = ‘Anna’;
student(2).name . last = ‘Tom’;
student(2).score = 94.50;
Student(3).name . first = ‘Jerry’
 The structure arrays can be accessed as :
Ex: >>student . score
ans=82.39
Student(1) score is also similar to that of student.
We can replace the contents of the student by
giving changed information.
Ex:>>student .grade=‘A’;
>>student . grade
ans=A
 By using MATLAB structure arrays can be created ,
accessed easily.
 MATLAB handles vector and matrices very nice . It
is an interpreted language.
 Quick plotting and analysis . It is an interactive
environment.
 Matrix based-handle and manipulate large data sets .
But it is slow compared to C or Java .
 If you want to learn Matlab Webtunix Solutions is one of the
best Artificial Intelligence Company in Chandigarh
who is working on Intelligent Web Frameworks Such as
MATLAB, Python, Hadoop, Big Data and Java.
 Here is the list of some companies which uses these MATLAB
Toolboxes and job roles offered by them:-
General Electric - (Job role)Controls Engineer
 Caterpillar - (Job role) Engineer - Model Based Developer
 Cyient - (Job role) System Engineer
Continental AG - (Job role) HIL Simulation Engineer
 Alstom Limited - (Job role) Control engineer
 Boeing International Corporation India Private
Limited - (Job role) Navigation and control engineer
 The MathWorks - (Job role) Automative system
engineer
 Satyam-Venture Engineering Services Private Limited
- (Job role) System modelling and system engineer
 Satyam-Venture Engineering Services Private Limited
- (Job role) Control engineer - Mechatronics
 ABB Group - Automation company - (Job role )
Domain test engineer
 DRDO - Defence Research and Development
Organization - (job role) Application support engineer
Structure Arrays

More Related Content

What's hot

Data structure
Data structureData structure
Data structureMohd Arif
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and UnionSelvaraj Seerangan
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueGhaffar Khan
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersAbdul Rahman Sherzad
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2Self-Employed
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1Kumar
 
Structures and Pointers
Structures and PointersStructures and Pointers
Structures and PointersPrabu U
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structureeShikshak
 
Coates p: the use of genetic programing in exploring 3 d design worlds
Coates p: the use of genetic programing in exploring 3 d design worldsCoates p: the use of genetic programing in exploring 3 d design worlds
Coates p: the use of genetic programing in exploring 3 d design worldsArchiLab 7
 
DBMS Question bank
DBMS Question bankDBMS Question bank
DBMS Question bankSara Sahu
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure NUPOORAWSARMOL
 
data structure
data structuredata structure
data structurehashim102
 
Coates p: the use of genetic programming for applications in the field of spa...
Coates p: the use of genetic programming for applications in the field of spa...Coates p: the use of genetic programming for applications in the field of spa...
Coates p: the use of genetic programming for applications in the field of spa...ArchiLab 7
 
Introduction to Data Structures and Linked List
Introduction to Data Structures and Linked ListIntroduction to Data Structures and Linked List
Introduction to Data Structures and Linked ListSelvaraj Seerangan
 
Day 5b statistical functions.pptx
Day 5b   statistical functions.pptxDay 5b   statistical functions.pptx
Day 5b statistical functions.pptxAdrien Melquiond
 

What's hot (20)

Data structure
Data structureData structure
Data structure
 
Structure in C
Structure in CStructure in C
Structure in C
 
R Datatypes
R DatatypesR Datatypes
R Datatypes
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and Union
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1
 
Algo>Abstract data type
Algo>Abstract data typeAlgo>Abstract data type
Algo>Abstract data type
 
Structures and Pointers
Structures and PointersStructures and Pointers
Structures and Pointers
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structure
 
Coates p: the use of genetic programing in exploring 3 d design worlds
Coates p: the use of genetic programing in exploring 3 d design worldsCoates p: the use of genetic programing in exploring 3 d design worlds
Coates p: the use of genetic programing in exploring 3 d design worlds
 
DBMS Question bank
DBMS Question bankDBMS Question bank
DBMS Question bank
 
Data structure
Data structureData structure
Data structure
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
data structure
data structuredata structure
data structure
 
Coates p: the use of genetic programming for applications in the field of spa...
Coates p: the use of genetic programming for applications in the field of spa...Coates p: the use of genetic programming for applications in the field of spa...
Coates p: the use of genetic programming for applications in the field of spa...
 
Introduction to Data Structures and Linked List
Introduction to Data Structures and Linked ListIntroduction to Data Structures and Linked List
Introduction to Data Structures and Linked List
 
Day 5b statistical functions.pptx
Day 5b   statistical functions.pptxDay 5b   statistical functions.pptx
Day 5b statistical functions.pptx
 

Similar to Structure Arrays

Similar to Structure Arrays (20)

Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Dsp file
Dsp fileDsp file
Dsp file
 
EE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manualEE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manual
 
Mit202 data base management system(dbms)
Mit202  data base management system(dbms)Mit202  data base management system(dbms)
Mit202 data base management system(dbms)
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
 
Matlab Overviiew
Matlab OverviiewMatlab Overviiew
Matlab Overviiew
 
Kevin merchantss
Kevin merchantssKevin merchantss
Kevin merchantss
 
KEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTKEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENT
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
The Very ^ 2 Basics of R
The Very ^ 2 Basics of RThe Very ^ 2 Basics of R
The Very ^ 2 Basics of R
 
MATLAB guide
MATLAB guideMATLAB guide
MATLAB guide
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 
Matlab OOP
Matlab OOPMatlab OOP
Matlab OOP
 
interfacing matlab with embedded systems
interfacing matlab with embedded systemsinterfacing matlab with embedded systems
interfacing matlab with embedded systems
 
Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4Introduction to matlab lecture 1 of 4
Introduction to matlab lecture 1 of 4
 
Matlab lecture
Matlab lectureMatlab lecture
Matlab lecture
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 

Recently uploaded

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Structure Arrays

  • 2.  About MATLAB  Arrays  Types of arrays  Structure arrays  Creating structures  Structure functions  Program  Accessing structure arrays  Summary
  • 3.  MATLAB (matrix laboratory) is a fourth-generation high-level programming language and interactive environment for numerical computation.  MATLAB is widely used as a computational tool in science and engineering encompassing the fields of physics , chemistry, math and all engineering streams. It is a range of applications including: • Signal processing and communications • Control systems • Computational biology
  • 4.  It is started developing MATLAB in the late 1970s.  CLEVE MOLER , the chairman of the computer science department at the university of New Mexico .  Moler and Steve Bangert together rewrote MATLAB in ‘C’ and founded Math works in 1984 to continue its development. CLEVE MOLER STEVE BANGERT
  • 5.  One of the strength of MATLAB is the capability to handle collections of items , called ARRAYS ,as if they were a single entity.  The array-handling feature means that MATLAB programs can be very short.  The array is the basic building block in MATLAB.
  • 6.  Numeric array  Character array  Logical array  Cell array  Structure array  Function handle array  Java array
  • 7.  Structure arrays are composed of structures.  Numeric, character and cell arrays all reference the individual elements by number.  Structures reference individual elements within each row (called “fields”) by name.  To access these fields, the dot “.” notation is used.  Assignment is as follows: Structurename.Fieldname = datatype;
  • 8.  Let’s create a simple structure: >>Person . first name = ‘ramesh’; Person .Last name = ‘ babu ’; Person.Address1 = ‘china’; Person . city = ‘america’; Person . state = ‘US’; Person . Zip = ‘30332-0001
  • 9.  >>person= first name: ’Ramesh’ last name: ’Babu’ address1:’china’ city : ‘America’ state : ‘US’ Zip: ‘30332-0001’ By creating simple structure then type in command window person that will display above result i.e is related to person details . Person(1) also gives same information.
  • 10.  s= struct(‘f1’,’v1’,’f2’,’v2’,...) creates a structure array with the fields ‘f1’,’f2’,… having the values ‘v1’,’v2’,... Ex: >>s= struct(‘type’,{‘big’,’little’},’color’,’red’,’x’,{3 4}) s=1x2 struct array with the fields: type color x . .
  • 11.  names=fieldnames(s) Return the fields names associated with the structure array S as names , a cell array of strings. Ex: >>names=fieldnames(s) names=‘type’ ‘color’ ‘x’  isfield(s,’field’) returns 1 if ‘field’ is the name of a field in the structure array s and 0 otherwise.
  • 12. Ex: >>isfield(s,’field’) ans=0 >>isfield(s,{‘type’,’color’,’x’}) ans=1 1 1  isstruct(s) Returns 1 if the array s is a structure array and 0 otherwise Ex: >>isstruct(s) ans=1  s=rmfield(s,’field’) removes the field ‘field’ from the structure array s
  • 13.  Ex: >>s=rmfield(s,’type’) s=1x2 struct array with fields: color x These are the structure functions and there descriptions.
  • 14.  c=structure2cell(s) converts structure array to cell array. Ex: >>clear s, s.category=‘tree’;s.height=37.4; s.name=‘bamboo’; >>c=struct2cell(s) c= ‘tree’ [37.4000] ‘bamboo’ >>f=fieldnames(s) f=‘category’ ‘height’ ‘name’
  • 15.  s=cell2struct(c,fields,dim) converts cell array to structure array. Here dim means dimensions . c means cell array. Ex: >>c={‘tree’,37.4,’bamboo’}; f={‘catgeory’,’height’,’name’}; s=cell2struct(c,f,2) s= category : ’tree’ height : 37.4000 name : ‘bamboo’
  • 16. Student . Name . first = ‘kusu’; student.name . last = ‘kalyan’; Student . score = 82.39; Student . grade = ‘B’; student(2).name . first = ‘Anna’; student(2).name . last = ‘Tom’; student(2).score = 94.50; Student(3).name . first = ‘Jerry’
  • 17.  The structure arrays can be accessed as : Ex: >>student . score ans=82.39 Student(1) score is also similar to that of student. We can replace the contents of the student by giving changed information. Ex:>>student .grade=‘A’; >>student . grade ans=A
  • 18.  By using MATLAB structure arrays can be created , accessed easily.  MATLAB handles vector and matrices very nice . It is an interpreted language.  Quick plotting and analysis . It is an interactive environment.  Matrix based-handle and manipulate large data sets . But it is slow compared to C or Java .
  • 19.  If you want to learn Matlab Webtunix Solutions is one of the best Artificial Intelligence Company in Chandigarh who is working on Intelligent Web Frameworks Such as MATLAB, Python, Hadoop, Big Data and Java.  Here is the list of some companies which uses these MATLAB Toolboxes and job roles offered by them:- General Electric - (Job role)Controls Engineer  Caterpillar - (Job role) Engineer - Model Based Developer  Cyient - (Job role) System Engineer Continental AG - (Job role) HIL Simulation Engineer  Alstom Limited - (Job role) Control engineer
  • 20.  Boeing International Corporation India Private Limited - (Job role) Navigation and control engineer  The MathWorks - (Job role) Automative system engineer  Satyam-Venture Engineering Services Private Limited - (Job role) System modelling and system engineer  Satyam-Venture Engineering Services Private Limited - (Job role) Control engineer - Mechatronics  ABB Group - Automation company - (Job role ) Domain test engineer  DRDO - Defence Research and Development Organization - (job role) Application support engineer