23.07.2012 Views

MATLAB C++ Math Library Reference

MATLAB C++ Math Library Reference

MATLAB C++ Math Library Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11<br />

mwArray field(const char *fieldname) const;<br />

mwSubArray field(const char *fieldname);<br />

Stream I/O Operators<br />

The two operators, >, are used for stream input and output.<br />

Technically, these stream operators are not member functions; they are friend<br />

functions.<br />

friend inline ostream& operator(istream &is, mwArray&)<br />

This is the stream extraction operator, capable of extracting, or reading, an<br />

mwArray from a stream. The stream can be any <strong>C++</strong> stream object, for example,<br />

standard input, a file, or a string. This function simply invokes Read() as<br />

described below.<br />

The stream operators call Read() and Write(), mwArray public member<br />

functions.<br />

void Read(istream&)<br />

Reads an mwArray from an input stream. An array definition consists of an<br />

optional scale factor and asterisk, *, followed by a bracket [, one or more<br />

semicolon-separated rows of double-precision floating-point numbers, and a<br />

closing bracket ].<br />

void Write(ostream&, int32 precision =5, int32 line_width =75) const<br />

Formats mwArray objects using the given precision (number of digits) and line<br />

width, and then writes the objects into the given stream. operator

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!