(# File: complexIn.m
 #
 # Sha Rabii 22-Jan-1997
 # Sha Rabii 15-Oct-1997, added initialize statements to allow re-reading
 #                        of the file when a FOR statement is used.
 #)

#include <stdlib.h>

MODEL complexIn

    stream parameter file;
    complex output y;
    char real[255];
    char imag[255];

INITIALIZE

    rewind (file);
    Enable();

EXECUTE

    if (fscanf(file, "%s %s\n", real, imag) < 0) return;

    y = complex(atof(real), atof(imag));

    ContinueSimulation();
    Enable();

END
