MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts...

22
1 © 2015 The MathWorks, Inc. MATLAB App and Toolbox Development David Sampson MathWorks

Transcript of MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts...

Page 1: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

1© 2015 The MathWorks, Inc.

MATLAB App and Toolbox Development

David Sampson

MathWorks

Page 2: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

2

Master class outline

App development

– Motivation

– Design patterns

– Object system technologies

– Demonstrations

Toolbox packaging

– Motivation

– Artifacts

– Structure

– Developer workflows

– User workflows

Page 3: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

3

App Development

Page 5: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

5

Model-view-controller pattern

Page 6: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

6

Object system technologies

Classes

– Properties

– Methods

– Events

– Attributes

Listeners

handle (and its derivatives)

The reference counter

Page 7: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

7

Model

Event notification

Property access, method call

HeartRateHistogramView StripChartView

MapViewPlayer

Page 8: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

8

Demonstrations:

Model

Simple view

Graphical view

Page 9: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

9

More class types

A chart is an object that provides a specific type of visualization via a

convenient API

Charts be used in apps, reports, and for ad hoc visualization

A view binds data to a chart

– When the data changes, the chart updates

– The data often lives in a model – as in model-view-controller – class

Patterns

– Chart: composite

– View: observer

Page 10: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

10

Demonstration:

Charts

Page 11: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

11

Toolbox packaging

Page 12: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

12

Page 13: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

13

MATLAB Toolbox files (.mltbx)

Available from R2014b

Packs multiple files into a single file to be distributed

Includes metadata and product dependencies

Single step to install (or update)

Configures MATLAB path

Registers apps and documentation

www.mathworks.com/help/matlab/matlab_prog/

create-and-share-custom-matlab-toolboxes.html

Page 14: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

14

Toolbox artifacts

Code

Apps

Examples

Documentation

Tests

Utilities

Page 15: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

15

Suggested toolbox structure

/my.prj

/util.m

/tbx

/my

/fcn.m

/Class.m

/mydoc

/howto.html

/example.m

/apps

/app.m

/releases

/tests

Page 16: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

16

Suggested toolbox structure

/my.prj

/util.m

/tbx

/releases

/tests

where tbx is what is released, and

contains…

/tbx/my

/Contents.m

/fcn.m

/Class.m

/mydoc

/howto.html

/example.m

/apps

/app.m

Page 17: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

17

Developer workflows

Creating

Packaging

Testing

Bundling apps

Managing dependencies

Distributing

Page 18: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

18

Demonstration:

Toolbox packaging

Page 19: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

19

User workflows

Viewing what is installed

Installing

Uninstalling

Updating

Launching apps

Viewing documentation

Writing code

Page 20: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

20

Demonstration:

Toolbox usage

Page 21: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

21

Learn more

Slides and some demos will be available

Demo station: “Building MATLAB Apps to Visualize Complex Data”

Training

– Building interactive applications in MATLAB

– Object-oriented programming in MATLAB

Workshops by MathWorks Consulting

– App development

– Testing

Page 22: MATLAB App and Toolbox Development - it.mathworks.com€¦ · –Motivation –Artifacts –Structure –Developer workflows –User workflows. 3 App Development. 4. 5 Model-view-controller

22

Thank you.

Questions?