Fortran mex routine mxGetClassName

バージョン 1.0.0.0 (8.36 KB) 作成者: James Tursa
A drop-in replacement for the TMW Fortran API function mxGetClassName routine that does not work.
ダウンロード: 859
更新 2009/9/25

ライセンスの表示

The Mathworks supplied mxGetClassName routine for Fortran does not work. This routine is a drop-in replacement. The following syntax and description is similar to The Mathworks documentation, except that this drop-in replacement routine returns a fixed 128 length character string. This routine only works for mex routines, since it relies on the mexCallMATLAB function. Thus, it will not work for engine applications.

IMPORTANT: Be sure to use my supplied version of the mxCopyPtrToCharacter routine, since the MATLAB supplied version in their API does not work. My version is listed at the end of the posted file.

Fortran Syntax

character*128 function mxGetClassName(pm)
mwPointer, intent(in) :: pm

Requires

#include "fintrf.h"

Arguments

pm

Pointer to any mxArray variable.

Description

Call mxGetClassName to determine the class of an mxArray. The class of an mxArray identifies the kind of data the mxArray is holding. For example, if pm points to a logical mxArray, then mxGetClassName returns logical.

This drop-in replacement routine fills the trailing part of the return string with blanks.

In addition to the routine itself, I have included a test driver routine, test_mxGetClassName.f and an associated file test_mxGetClassName.m. After running mex -setup and selecting a Fortran compiler, simply issue the command test_mxGetClassName(variable) and the mex function will self-build and then execute.

引用

James Tursa (2024). Fortran mex routine mxGetClassName (https://www.mathworks.com/matlabcentral/fileexchange/25406-fortran-mex-routine-mxgetclassname), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersFortran with MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0