错误提示:Subscripted assignment dimension mismatch.。

clear
clc
num=zeros(500,1000);
fei=9;
for t=1:10
wang=[num2str(fei) ':' num2str(fei)];
num(t,:)= xlsread('shujufenlie.xlsx', wang);
fei=fei+3;
end

 採用された回答

wewey
wewey 2022 年 11 月 23 日

0 投票

clear
clc
fei=9;
num = cell();
for t=1:10
wang=['B' num2str(fei) ':' 'APA' num2str(fei)];
num{t}= xlsread('shujufenlie.xlsx', wang);
fei=fei+3;
end
因为你的数据表中数据列数长短不一,我也不知道该怎样,不过我试着将num类型定义为cell ,这样你的每一行数据都放在一个元胞数组的单元里,引用第一行数据输入命令行num{1}就可以了。我只能帮你到这里了:)

その他の回答 (0 件)

タグ

質問済み:

2022 年 11 月 23 日

回答済み:

2022 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!