by loading one script file into another script file i got some error Number of columns on line 1 of ASCII file templates.mat must be the same as previous lines. help me out
1 次查看(过去 30 天)
显示 更早的评论
my script file which i have to load is clc; close all; A=imread('C:\Users\dilib.DL-37.000\Desktop\A.bmp'); B=imread('C:\Users\dilib.DL-37.000\Desktop\B.bmp'); C=imread('C:\Users\dilib.DL-37.000\Desktop\C.bmp'); D=imread('C:\Users\dilib.DL-37.000\Desktop\D.bmp'); E=imread('C:\Users\dilib.DL-37.000\Desktop\E.bmp'); F=imread('C:\Users\dilib.DL-37.000\Desktop\F.bmp'); G=imread('C:\Users\dilib.DL-37.000\Desktop\G.bmp'); H=imread('C:\Users\dilib.DL-37.000\Desktop\H.bmp'); I=imread('C:\Users\dilib.DL-37.000\Desktop\I.bmp'); J=imread('C:\Users\dilib.DL-37.000\Desktop\J.bmp'); K=imread('C:\Users\dilib.DL-37.000\Desktop\K.bmp'); L=imread('C:\Users\dilib.DL-37.000\Desktop\L.bmp'); M=imread('C:\Users\dilib.DL-37.000\Desktop\M.bmp'); N=imread('C:\Users\dilib.DL-37.000\Desktop\N.bmp'); O=imread('C:\Users\dilib.DL-37.000\Desktop\O.bmp'); P=imread('C:\Users\dilib.DL-37.000\Desktop\P.bmp'); Q=imread('C:\Users\dilib.DL-37.000\Desktop\Q.bmp'); R=imread('C:\Users\dilib.DL-37.000\Desktop\R.bmp'); S=imread('C:\Users\dilib.DL-37.000\Desktop\S.bmp'); T=imread('C:\Users\dilib.DL-37.000\Desktop\T.bmp'); U=imread('C:\Users\dilib.DL-37.000\Desktop\U.bmp'); V=imread('C:\Users\dilib.DL-37.000\Desktop\V.bmp'); W=imread('C:\Users\dilib.DL-37.000\Desktop\W.bmp'); X=imread('C:\Users\dilib.DL-37.000\Desktop\X.bmp'); Y=imread('C:\Users\dilib.DL-37.000\Desktop\Y.bmp'); Z=imread('C:\Users\dilib.DL-37.000\Desktop\Z.bmp'); %lower case letters a=imread('C:\Users\dilib.DL-37.000\Desktop\123\a.bmp'); b=imread('C:\Users\dilib.DL-37.000\Desktop\123\b.bmp'); c=imread('C:\Users\dilib.DL-37.000\Desktop\123\c.bmp'); d=imread('C:\Users\dilib.DL-37.000\Desktop\123\d.bmp'); e=imread('C:\Users\dilib.DL-37.000\Desktop\123\e.bmp'); f=imread('C:\Users\dilib.DL-37.000\Desktop\123\f.bmp'); g=imread('C:\Users\dilib.DL-37.000\Desktop\123\g.bmp'); h=imread('C:\Users\dilib.DL-37.000\Desktop\123\h.bmp'); i=imread('C:\Users\dilib.DL-37.000\Desktop\123\i.bmp'); j=imread('C:\Users\dilib.DL-37.000\Desktop\123\j.bmp'); k=imread('C:\Users\dilib.DL-37.000\Desktop\123\k.bmp'); l=imread('C:\Users\dilib.DL-37.000\Desktop\123\l.bmp'); m=imread('C:\Users\dilib.DL-37.000\Desktop\123\m.bmp'); n=imread('C:\Users\dilib.DL-37.000\Desktop\123\n.bmp'); o=imread('C:\Users\dilib.DL-37.000\Desktop\123\o.bmp'); p=imread('C:\Users\dilib.DL-37.000\Desktop\123\p.bmp'); q=imread('C:\Users\dilib.DL-37.000\Desktop\123\q.bmp'); r=imread('C:\Users\dilib.DL-37.000\Desktop\123\r.bmp'); s=imread('C:\Users\dilib.DL-37.000\Desktop\123\s.bmp'); t=imread('C:\Users\dilib.DL-37.000\Desktop\123\t.bmp'); u=imread('C:\Users\dilib.DL-37.000\Desktop\123\u.bmp'); v=imread('C:\Users\dilib.DL-37.000\Desktop\123\v.bmp'); w=imread('C:\Users\dilib.DL-37.000\Desktop\123\w.bmp'); x=imread('C:\Users\dilib.DL-37.000\Desktop\123\x.bmp'); y=imread('C:\Users\dilib.DL-37.000\Desktop\123\y.bmp'); z=imread('C:\Users\dilib.DL-37.000\Desktop\123\z.bmp');
%Number %one=imread('letters_numbers\1.bmp'); %two=imread('letters_numbers\2.bmp'); %three=imread('letters_numbers\3.bmp'); %four=imread('letters_numbers\4.bmp'); %five=imread('letters_numbers\5.bmp'); %six=imread('letters_numbers\6.bmp'); %seven=imread('letters_numbers\7.bmp'); %eight=imread('letters_numbers\8.bmp'); %nine=imread('letters_numbers\9.bmp'); %zero=imread('letters_numbers\0.bmp'); %*-*-*-*-*-*-*-*-*-*-*- letter=[A B C D E F G H I J K L M... N O P Q R S T U V W X Y Z]; %number=[one two three four five... % six seven eight nine zero];
lowercase = [a b c d e f g h i j k ... l m n o p q r s t u v w x y z]; character=[letter number lowercase]; templates=mat2cell(character,42,[24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 24 ... 24 24 24 24 24 24 24 24 ... 24 24]); save ('templates','templates') clear all
1 个评论
Geoff Hayes
2014-5-28
It probably would have been more helpful if you had attached your script to your question rather than pasting it into the question body. Then you could have added more context surrounding the script (which appears to load upper and lower case letters, and numbers) and the line at which it fails.
I noticed that the script seems to have the reading of numbers commented out, yet the code still tries to concatenate the number matrix into character. Doesn't this generate an error when you run the script?
Try debugging the code. At the beginning of your script, add the following line
dbstop if error
which will cause the code to pause at the line that generated the error. Then you can observe the variables and see that they make sense.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!