How can I call the method of one class in another class method as a input argument?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
surendra kumar Aralapura mariyappa
le 15 Mai 2019
Modifié(e) : surendra kumar Aralapura mariyappa
le 15 Mai 2019
classdef Conductance
properties
Conductivity
Contact_Area
Breadth
end
properties(Dependent)
Leitwert
end
methods
function obj = Conductance(Lambda, A_1_2, b)
obj.Conductivity = Lambda;
obj.Contact_Area = A_1_2;
obj.Breadth = b;
end
function L = get.conductance(obj)
ind = obj.Conductivity > 0 || obj.Contact_Area > 0 || obj.Breadth > 0 ;
L = obj.Conductivity(ind) *obj.Contact_Area(ind)/(.5*obj.Breadth(ind));
end
end
end
I have a different objects of same properties with different values. Now I need to calculate the conductance between two nodes after caculating the conductance of each node. How can I write code to find the conductance between two nodes in the same class file? if not, How can I call the class Conductance in another class to find the total conductance?
4 commentaires
Geoff Hayes
le 15 Mai 2019
I have a module of 6 different objects(different values) which share the common properties(Conductivity, Breadth, Area).
So does that mean they are six instances of the class Conductance? Or do you have six different classes that have the same set of three properties?
Réponses (0)
Voir également
Catégories
En savoir plus sur Sample Class Implementations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!