-
Help with Matlab Script
Our script works properly when it doesn't have to incorporate the very beginning portion to read 16 different sheets titled u1-u16 in our Excel file. Why won't the first part of our string work (in red)?
(and yes our filename is correct)
for k=1:16
name=['u', num2str(k)]
AA=xlsread('dataB.xlsx','name')
AB=AA>=.8 & AA<=1.2;
g=ones(3) ;
for j=1:14
for i=1:14
if AB(i:2+i,j:2+j)==g(1:3,1:3)
A(j,i)=1;
else
A(j,i)=0;
end
end
end
end
imagesc(AB)
-
Try changeing
Code:
AA=xlsread('dataB.xlsx','name')
to
Code:
AA=xlsread('dataB.xlsx',name)
You want to pass the variable "name" not the string 'name'
I haven't tested it, but I would suspect that you should be ok if you modify that line.
Elbarto