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

4 次查看(过去 30 天)
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.

采纳的回答

MathWorks Support Team
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2009b

Community Treasure Hunt

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

Start Hunting!

Translated by