Beispiel #1
0
        /// <summary>
        /// Open a mat file with certain mode.
        /// </summary>
        /// <param name="fileName">The mat file full name.</param>
        /// <param name="mode">the open mode which supported 'r', 'w', 'u'.</param>
        /// <returns>return matfile object.</returns>
        public static MatFile Open(string fileName, string mode)
        {
            // check mode
            //if (!File.Exists(fileName))
            //    throw new FileNotFoundException("The mat file is not found!", fileName);

            SafeMATFilePtr pa = mat.matOpen(fileName, mode);

            if (pa.IsInvalid)
            {
                throw new ArgumentException("The mat file is invalid.");
            }

            return(new MatFile(pa));
        }
Beispiel #2
0
 internal MatFile(SafeMATFilePtr pa)
 {
     this.NativeObject = pa;
     CheckActive();
 }