CIFER®-MATLAB Interfaces: Development and ... - Cal Poly
CIFER®-MATLAB Interfaces: Development and ... - Cal Poly
CIFER®-MATLAB Interfaces: Development and ... - Cal Poly
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
3.1.2 Problems Encountered <strong>and</strong> Solutions<br />
The first, <strong>and</strong> perhaps most fundamental, problem encountered while developing this code was<br />
the structure of the interface itself. Creating an interface is difficult because no one knows exactly<br />
what is desired until they see <strong>and</strong> interact with it. Additionally, no solution is necessarily the right<br />
or best solution. On one h<strong>and</strong>, there was a significant drive to have the interface of new code<br />
mimic the old CIFER ® interface. On the other h<strong>and</strong>, it made equal sense to update older CIFER ®<br />
methods to more modern implementation, <strong>and</strong> to make more drastic changes to the layout. This<br />
question was more an issue for the GUI, but still affected the comm<strong>and</strong>-line interface.<br />
One method that <strong>MATLAB</strong> uses to gather large amounts of input is through a series of namevalue<br />
pairs. Essentially, the name of a variable is given as input immediately followed by its<br />
value. The pros are that the lists of variables do not have to be provided in a particular order, <strong>and</strong><br />
variables meant to retain default values need not be specified. The con is that inputs are twice as<br />
long as they might otherwise need to be. Figure 3.1 shows a simple example of name-value input<br />
to a fictional function. Another possible input method is to use a structure. Structures are a<br />
‘parent’ data type in which various other data types can be stored. Thus one structure might<br />
contain integers, arrays, <strong>and</strong> strings organized in the ‘fields’ of the structure. Structures are<br />
reasonably well organized, <strong>and</strong> easy to deal with from a programming st<strong>and</strong>point; however the<br />
format can be intimidating to non-programmers. Figure 3.1 also shows a simple structure layout,<br />
<strong>and</strong> how one structure used as input could replace name-value pairs.<br />
22