/ / Matlab Excelファイル内の列数 - excel、matlab

ExcelのファイルのMATLABの数 - excel、matlab

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;

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

回答:

回答№1は2

何について:

[num, txt, raw] = xlsread("example2.xlsx");
intCol = size(raw, 2);