Assigning a function with multiple outputs to a structure
Mostra commenti meno recenti
I have a function which has three outputs:
[krW, krO, krG] = relPerm3PH(sw, sg, varargin)
I also have a structure which contains the following fields:
fluid.krW
fluid.krO
fluid.krG
I am wondering if it is possible/how I can call my function to within the structure in order to calculate the specific (only one) outputs?
3 Commenti
jgg
il 9 Dic 2015
[fluid.krW, fluid.krO, fluid.krG] = relPerm3PG(...) should work? Is there a reason this is not what you want?
Alice Stembridge
il 9 Dic 2015
Modificato: Alice Stembridge
il 9 Dic 2015
jgg
il 10 Dic 2015
I'm unclear now on exactly what you're trying to do. The way that is written indicates that fluid.mu0 would be a function handle. Is that intended?
The object, as a function handle, can still have multiple outputs. Then fluid.mu0(x,vars) would returns multiple outputs.
Perhaps you could elaborate some more on what you are trying to do?
Risposte (0)
Categorie
Scopri di più su Whos in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!