Code covered by the BSD License  

Highlights from
Optimization of a Double Wishbone Suspension System

image thumbnail

Optimization of a Double Wishbone Suspension System


Stuart Kozola (view profile)


31 Oct 2006 (Updated )

Demo files from the Webinar "Introduction to Optimization with MATLAB(R) Products" Oct. 26, 2006

function importfile(fileToRead1,varargin)
%  Imports data from the specified file
%  FILETOREAD1:  file to read
%  other use: 
%     importfile(fileToRead1,'caller') --> assign to current workspace

%  Auto-generated by MATLAB on 19-Oct-2006 14:59:46

if nargin > 1
    wrkspc = varargin{1};
    wrkspc = 'base';

% Import the file
newData1 = importdata(fileToRead1);

% For some XLS and other spreadsheet files, returned data are packed
% within an extra layer of structures.  Unpack them.
fields = fieldnames(; ={1});
fields = fieldnames(newData1.textdata);
newData1.textdata = newData1.textdata.(fields{1});
fields = fieldnames(newData1.colheaders);
newData1.colheaders = newData1.colheaders.(fields{1});

% Break the data up into a new structure with one field per column.
colheaders = genvarname(newData1.colheaders);
for i = 1:length(colheaders)
    dataByColumn1.(colheaders{i}) =, i);

% Create new variables in the base workspace from those fields.
vars = fieldnames(dataByColumn1);
for i = 1:length(vars)
    assignin(wrkspc, vars{i}, dataByColumn1.(vars{i}));

Contact us