Files for the 2012 Webinar "Tips and Tricks - Getting Started Using Optimization with MATLAB"
20 Nov 2012
These are the files that were used for the demonstrations in the webinar.
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
% Vdata = voltageCurve(Tdata, x, Res, ThVal, ThBeta)
% See also RunThermistorExample
% Copyright (c) 2012, The MathWorks, Inc.
% All rights reserved.
%% 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);