[PDF] [PDF] Object-Oriented Programming in MATLAB® Helsinki 28 - MathWorks

Introduction to Object-Oriented MATLAB Antti Löytynoja Demonstration: Procedural Programming ▫ Simulate a bank Why Object-Oriented Programming?



Previous PDF Next PDF





[PDF] Object-Oriented Programming in MATLAB® Helsinki 28 - MathWorks

Introduction to Object-Oriented MATLAB Antti Löytynoja Demonstration: Procedural Programming ▫ Simulate a bank Why Object-Oriented Programming?



[PDF] Introduction to Object-Oriented Programming in MATLAB - MathWorks

Object-oriented programming in MATLAB – Classes in MATLAB – Advantages of object oriented design – Example: Designing a portfolio tracker ▫ Events in 



[PDF] Introduction to Object-Oriented Programming in MATLAB - MIT

2011 The MathWorks, Inc Introduction to Object-Oriented Programming in MATLAB Jamie Winter Sr Account Manager Abhishek Gupta Application Engineer 



[PDF] Object oriented programming and classes in MATLAB - University of

Object Oriented Programming is the abstraction of ideas and items into data and the methods (functions) that operate on them OOP in MATLAB of a class To use a class one only needs to know the interface to the class (i e the methods of the class)



[PDF] Object Oriented Programming

Outline Types of programming methodologies How to implement OOP in Matlab Data and Functions Classes : two variations built in Matlab 



[PDF] W1005 Intro to CS and Programming in MATLAB Object Oriented

Object Oriented Programming (OOP) Fall 2014 Instructor: Classes in MATLAB • Self-‐ objects ▫ To generate a new object we use a constructor method 3 



[PDF] Introduction to Object-Oriented Programming in MATLAB

Programming in MATLAB By Stuart McGarrity OBJECT-ORIENTED PROGRAMMING (00) APPLIES TO SOFTWARE DEVELOPMENT the standard science 



[PDF] Object oriented programming - Uni Oldenburg

However, it is possible to combine classical control flow with the use of objects • Matlab classes: o In Matlab, every data value is assigned to a class (I have 



[PDF] Object-Oriented Programming

At this point, consider moving your MATLAB programming tasks to object- oriented designs Understand a Problem in Terms of Its Objects Thinking in terms of 

[PDF] matlab object oriented programming pdf

[PDF] matlab plot color coded

[PDF] matlab plot colormap

[PDF] matlab program to calculate fourier series coefficients associated with square wave

[PDF] matlab programming questions and answers pdf

[PDF] matlab programs examples pdf

[PDF] matlab return value from function

[PDF] matlab solve quadratic equation

[PDF] matlab solve simultaneous equations

[PDF] matlab solve system of nonlinear equations multiple solutions

[PDF] matrice carrée d'ordre 1

[PDF] matrice carrée d'ordre 2 inversible

[PDF] matrice carrée d'ordre 3 inversible

[PDF] matrice carrée d'ordre 4

[PDF] matrice carrée d'ordre 5

1

© 2016 The MathWorks, Inc.

Introduction to Object-Oriented MATLAB

2

Demonstration: Procedural Programming

ƒSimulate a bank account using a structure and

some functions

Structures (data)

Functions (actions)

4

Procedural Programming

ƒEasy to learn

ƒMinimal planning

ƒNo formal relationshipbetween data and functions

ƒEvery detail is exposed

5

Why Object-Oriented Programming?

ƒBuild robust applications

Build a relationship between data and actions

Control data and actions

ƒDesign building blocks for developing applications

Eases code reuse

Enhance collaboration

6

Progression of Programming Techniques

Actions

Data function script command line value variable structure classLevel of Abstraction / Sophistication

Application Complexity

7

Object-Oriented Terminology

ƒClass

Blueprint of an idea

Properties(data)

Methods(actions)

ƒObject

Specific example of a class

Instance

Any number of objects of a class can exist

An element object

Definition Class

14

Demonstration: Building a Simple Class

ƒDescribe a bank account using a class

Properties (data)

Methods (actions)

ƒUse the object like a structure

15

Objects

ƒEasy to create

ƒManage their own data

ƒInterchangeable with a structure

No other code changes required

Propertiesbehave similar to field names

17

Objects with Methods

ƒHave immediate access to

their own data (properties)

ƒAllow you to overload

existing functions

ƒAllow you to perform custom actions at

creation and deletion (constructor and destructor) 18

AccountAccount

Address

VIP status

Deactivate

Number

etc.

Credit

history

Balance

Name

Withdraw

Accumulate

Deposit

Encapsulation

19

ƒSeparates the interface

from the implementation

ƒSimplifies object use

ƒBecomes a building block

Withdraw

Accumulate

Deposit

Balance

Name

Encapsulation

20

Demonstration: Applying Attributes

ƒControl access

Access = public

Access = protected

ƒRestrict modification

Constant

Dependent

21

Using a Class as a Building Block

All accounts

Normal account

All private accounts

Credit account

22

Demonstration: Creating a Credit Account

ƒDefine a new class

CreditAccount

ƒInheritfrom the existing

class Accountto reuse code

ƒAdd two additional properties,

overload withdraw -function

ƒUse the credit account

Credit

Name

Balance

23

Inheritance

ƒSubclasssubstitutes

for the superclass

ƒAllows re-envisioning

and re-implementing the superclass

ƒBuilds on proven code

ƒAllows inheriting from the base MATLAB classes 24

Summary

ƒO-O MATLAB is a sophisticated way of building MATLAB apps Follows the same principles as any other O-O language

ƒBuilds robust code (encapsulation)

ƒAllows you to reuse code (inheritance)

ƒGood when building larger apps and if many people contributing to/using code 25

Additional material

47

© 2016 The MathWorks, Inc.

Thank You!

quotesdbs_dbs14.pdfusesText_20