Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Entrada/Saída de Arquivos Matlab Binários > matfile_open

matfile_open

Opens a Matlab binary MAT-file.

Syntax

fd = matfile_open(filename[, mode[, version]])

Arguments

filename

String: the path of the file. Must contain only ANSI character.

mode

String: file access type ("r" by default).

  • "r": opens the file for reading.

  • "w": creates an empty file or opens it for writing.

version

Scalar string: file version format ("5" by default).

  • "5": Matlab 5 file.

  • "7.3": Matlab 7.3 file.

fd

Real: file descriptor (-1 if opening failed).

Description

Opens a Matlab binary MAT-file for reading or writing data.

If mode is set to w, the content of filename will be reseted.

Examples

A = rand(10, 10);
B = sprand(100, 100, 0.1);
savematfile("test_matfile.mat", "A", "B", "-v6");
clear();
fd = matfile_open("test_matfile.mat");
matfile_listvar(fd)
matfile_close(fd);

//fd = matfile_open("test_matfile.mat", "w"); // Empty test_matfile.mat

//fd = matfile_open("test_matfile.mat", "w", "7.3"); // Empty test_matfile.mat as a Matlab 7.3 file

See also

Bibliography

This function uses MATIO library ( http://sourceforge.net/projects/matio/ ).

History

VersionDescription
5.5.0 Support for Matlab 7.3 files.
Report an issue
<< matfile_listvar Entrada/Saída de Arquivos Matlab Binários matfile_varreadnext >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:58:45 CET 2018