Advanced Programming Techniques in MATLAB®
Advanced Programming Techniques in MATLAB
Loren Shure MathWorks, Inc.
? 2015 MathWorks, Inc. 1
Agenda
MATLAB and memory
? What you as a programmer should know
Passing arrays How structures use memory
Functions of all types
? Introduction/Review of MATLAB function types ? Applications of new nested functions
Solving optimization problems Building a graphical user interface for volume visualization Building 2-figure GUIs (Optional)
2
MATLAB and Memory
Passing arrays to functions
? When does MATLAB copy memory?
function y = foo(x,a,b) a(1) = a(1) + 12; y = a*x+b;
Calling foo
y = foo(1:3,2,4) ? i.e., x = 1:3, a = 2, b = 4
>> edit foo.m
3
In-place Optimizations
When does MATLAB do calculations "in-place"? x = 2*x + 3; y = 2*x + 3;
4
In-place Optimizations
When does MATLAB do calculations "in-place"?
function testInPlace
x = randn(n,1);
x = myfunc(x);
% vs. y = myfunc(x)
x = myfuncInPlace(x); % vs. y = myfuncInPlace(x)
function x = myfuncInPlace(x) x = sin(2*x.^2+3*x+4);
function y = myfunc(x) y = sin(2*x.^2+3*x+4);
>> edit myfuncInPlace myfunc testInPlace
%separate functions, separate files
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- carl wick joel esposito and ken knowles the matlab
- matlab a practical introduction to
- matlab 7 object oriented programming
- matlab programming tips
- advanced programming techniques in matlab
- e 177 advanced programming with matlab 3 units
- egr115 homework exercises programmer defined functions
- ftd2xx programmer s guide version 2
- scalars and variables
- cs111 matlab functions tr
Related searches
- cross selling techniques in banking
- composition techniques in writing
- suggestive selling techniques in restaurants
- upselling techniques in hotels
- questioning techniques in the classroom
- memory management techniques in os
- promotional techniques in marketing
- referencing techniques in academic writing
- techniques in advertising
- statistical techniques in research
- sampling techniques in research pdf
- quantitative techniques in management pdf