%% Calculate Efficiency for a Circuit
%
% This example shows how to calculate efficiency based on the power 
% dissipated by blocks in a circuit using the |ee_getEfficiency| function.
%
% Open the model. At the MATLAB&reg; command prompt, enter:
model = 'ee_converter_dcdc_class_e'; 
open_system(model) 
%%
% The load in the model is represented by the R Load resistor. No other 
% blocks with |power_dissipated| variables contain |Load| in their names. 
% Therefore, you can use the string |Load| as the |loadIdentifier| 
% argument.
%
% If no string at least partially matches the names of all load blocks in 
% your circuit, rename the load blocks using a schema that satisfies the 
% matching criteria for the |loadIdentifier| argument.
%
% This example model has data logging enabled. Run the simulation and 
% create the simulation log variable.
sim(model)
%%
% The simulation log variable |simlog_ee_converter_dcdc_class_e| is saved 
% in your current workspace.
%
% Calculate efficiency and display the results.
efficiency = ee_getEfficiency('Load',simlog_ee_converter_dcdc_class_e)



%%
% Copyright 2017 The MathWorks, Inc.

