0

Excelファイルに書き込まれた列の数を取得するMatlabのコマンドはありますか?

これは私のExcelファイルです: ここに画像の説明を入力してください

これは私のコードです:

e = actxserver ('Excel.Application'); %# open Activex server
filename = fullfile(pwd,'example2.xlsx'); %# full path required
ewb = e.Workbooks.Open(filename); %# open the file
esh = ewb.ActiveSheet;

そして私は試しました:

intCol = Range('IV1').End(xlLeft).Col;

ありがとうございました :]

4

1 に答える 1

2

どうですか:

[num, txt, raw] = xlsread('example2.xlsx');
intCol = size(raw, 2);
于 2012-04-16T12:07:08.580 に答える