Accessing elements in an mxArray that contains only numbers

1 回表示 (過去 30 日間)
Caroline
Caroline 2013 年 7 月 29 日
I am using the MATLAB engine and xlsread to read an excel spreadsheet. I use xlsread in the following way:
engEvalString(ep, "[num, text, raw] = xlsread('C:\\rest_of_file_path', 'Data'");
However when I try to use mxGetCell(num,1) or any other index (i.e. mexGetCell(num, 0), mxGetCell(num, 30), mxGetCell(num,4)) it throws the following exception:
Access violation reading location 0x3f7a9fc7.
But when I use either text or raw instead of num it doesn't throw an exception. For example, the following two statements throw no exceptions:
mxGetCell(raw,1)
mxGetCell(text,1)
Does anyone know why this could be happening?
Thanks!
  2 件のコメント
James Tursa
James Tursa 2013 年 7 月 29 日
編集済み: James Tursa 2013 年 7 月 29 日
Is num NULL? How are you importing num, text, and raw into your program?
Caroline
Caroline 2013 年 7 月 30 日
I am using engGetVariable to get them into my C++ program

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeExternal Language Interfaces についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by