求教 如何快速查找对应序号并赋值。
Afficher commentaires plus anciens
描述:有A,B两个文件,A>B,第一列是编号。现在要把B中每个编号下的整行数据对应导入A
Size比较大,我这样很慢,请问有没有什么办法
clc;clear
a=xlsread('文件A')
b=xlsread('文件B')
i=a(:,1)
for k=1:23133
[m,n]=find(i==b(k,1))
a(m,:)=b(k,:)
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Other Formats dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!