错误提示: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

 Accepted Answer

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}就可以了。我只能帮你到这里了:)

More Answers (0)

Tags

Asked:

on 23 Nov 2022

Answered:

on 23 Nov 2022

Community Treasure Hunt

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

Start Hunting!