Programming and Data Types    

Program 3b -- Vector Comparison, Vectorized

Here is the vectorized version of the same program. Note that there is little difference in performance between the accelerated while loop, shown in "Program 3a", and the vectorized code shown below. This means that, with accelerated MATLAB, you have the freedom to choose the style of coding that you prefer for each MATLAB application without affecting performance.

The table below also shows little difference in the times measured for running the vectorized code on unaccelerated and accelerated versions of MATLAB. You will not see a significant performance improvement in vectorized programs when run with the accelerator.

Operating System
MATLAB 6.1
MATLAB 6.5
Performance Gain
Windows
0.7 sec.
0.6 sec.
x 1.2
Linux
1.0 sec.
0.9 sec.
x 1.1
Solaris
1.2 sec.
1.2 sec.
x 1.0

Here is the vectorized version of the vfind program:


  Program 3a -- Vector Comparison, with Loop Program 4 -- Tic-Tac-Toe