
MODIFIED DISTILLATION PROGRAM
To further illustrate the benefits of utilizing the MATLAB Engine, let’s try
to improve an existing C program. Let us consider the C program previously
developed, which solves the distillation problem (Program Listing 4.5), and
incorporate the plot features of MATLAB.
By adding a graph, the user can further appreciate the program by visually
verifying the result.
Program Listing 9.10:
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include “engine.h”
4 #include “benz_tol.h”
5 int main()
6 {
7 Engine *ep;
8 mxArray *X=NULL,*Y=NULL,*XMIN=NULL,*YMIN=NULL,*XACT=
NULL,*YACT =NULL;
9 double x[11] = { 0.0, 0.1, ...