How can I gain performance when working with MATLAB class objects using the Parallel Computing Toolbox 4.2(R2009b)?

1 view (last 30 days)
I would like to see an example of using Parallel Computing Toolbox with MATLAB classes and objects. Specifically, I would like to see how to ensure that Parallel Computing Toolbox can speed up using class methods.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 9 Dec 2009
The attached zip file model a simple banking system. The files, "BankAccount.m" and "AccountManager.m" are the class files for bank account and account manager classes.
The BankAccount class takes care of creating a BankAccount and making deposits or withdrawals. The AccountManager class ensures that there are sufficient funds in the account, and has information on whether an account is open or closed.
Apart from the class files, for parallel processing purposes, 2 additional files are also present: "makeDeposit.m" and "testMObj.m".
"makeDeposit.m" is meant to deposit a specified amount into a bank account. "testMObj.m" is meant for parallelizing this deposit procedure using createParallelJob and createTask methods.
You can run "testMObj.m" to see the job creation and the parallel processed output.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products


Release

R2009b

Community Treasure Hunt

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

Start Hunting!