Code covered by the BSD License  

Highlights from
Tips & Tricks: Getting started using optimization with MATLAB

image thumbnail

Tips & Tricks: Getting started using optimization with MATLAB

by

 

27 Aug 2008 (Updated )

Demo files from the August 21, 2008 Webinar

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

VEMap(x,RPM,Pratio,VE)
function ve = VEMap(x,RPM,Pratio,VE)

x(1) = x(1);%*10000;

Xeval = linspace(1000,6000,300)';
Yeval = linspace(0,1,300)';

% Make them into a grid for use in surf
[xx,yy] = meshgrid(Xeval,Yeval);

zz = griddata(RPM,Pratio,VE,xx,yy,'cubic');

ve = interp2(xx,yy,zz,x(1),x(2));

if isnan(ve)
    ve = -1e10;
end

Contact us