Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

Is the Comsol Model Class a Handle Class in Matlab? Can/should I pass it as "call by reference"?

$
0
0
Hey there,

I'm new to Comsol and I'm developing my first Matlab application using LiveLink. As I understand the object oriented concept in Matlab, there are two types of classes. Value Classes and Handle Classes. Instances of the latter can be used as function argument in the sense of "call by reference".

Which of those two types of Matlab classes belongs the Comsol Model Object to?
If I load a Comsol model in Matlab using the Matlab code

model = mphload(mymodel.mph, 'My Model');

can I then pass the above variable to some Matlab function "myFun()" as call by reference, modify in that function the Model Object and see the modifications in the main Matlab script when returning from "myFun()"?

Is that all save to do or what is the best practice to structure and modularize Matlab code when using the Comsol Model Object?

Thanks a lot in advance,
Joerg

Viewing all articles
Browse latest Browse all 26527

Trending Articles