Code covered by the BSD License

# Files for the 2012 Webinar "Tips and Tricks - Getting Started Using Optimization with MATLAB"

### Seth DeLand (view profile)

These are the files that were used for the demonstrations in the webinar.

voltageCurve(Tdata,x,Res,ThVal,ThBeta)
```function Vdata = voltageCurve(Tdata,x,Res,ThVal,ThBeta)
%VOLTAGECURVE Calculate voltage curve given component values
%   VOLTAGECURVE(TDATA, X, RES, THVAL, THBETA) returns the voltage curve
%   calculated at the temperatures in TDATA.  RES, THVAL, and THBETA are
%   values of the available resistor and thermistor components.  X is a
%   vector of integers used to index into the resistor and thermistor
%   vectors.
%
%   Syntax
%      Vdata = voltageCurve(Tdata, x, Res, ThVal, ThBeta)
%

% Copyright (c) 2012, The MathWorks, Inc.
%% Index into Resistor and Thermistor arrays to extract component values
y(1) = Res(x(1));
y(2) = Res(x(2));
y(3) = Res(x(3));
y(4) = Res(x(4));
y(5) = ThVal(x(5));
y(6) = ThBeta(x(5));
y(7) = ThVal(x(6));
y(8) = ThBeta(x(6));

%% Calculate temperature curve for a particular set of components
Vdata = tempCompCurve(y, Tdata);```