How to create a .mat file
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to create NewTemplates.mat file
I got an error as
*Error using horcat
Dimensions of matrices being concatenated are not consistent.
Error in
letter=[A Afill B Bfill C D Dfill E F G H I J K L M...*
code I used to create .mat file is
%CREATE TEMPLATES
%Letter
A=imread('A.bmp');B=imread('B.bmp');
C=imread('C.bmp');D=imread('D.bmp');
E=imread('E.bmp');F=imread('F.bmp');
G=imread('G.bmp');H=imread('H.bmp');
I=imread('I.bmp');J=imread('J.bmp');
K=imread('K.bmp');L=imread('L.bmp');
M=imread('M.bmp');N=imread('N.bmp');
O=imread('O.bmp');P=imread('P.bmp');
Q=imread('Q.bmp');R=imread('R.bmp');
S=imread('S.bmp');T=imread('T.bmp');
U=imread('U.bmp');V=imread('V.bmp');
W=imread('W.bmp');X=imread('X.bmp');
Y=imread('Y.bmp');Z=imread('Z.bmp');
Afill=imread('fillA.bmp');
Bfill=imread('fillB.bmp');
Dfill=imread('fillD.bmp');
Ofill=imread('fillO.bmp');
Pfill=imread('fillP.bmp');
Qfill=imread('fillQ.bmp');
Rfill=imread('fillR.bmp');
M1=imread('M2.jpg');
%Number
one=imread('1.bmp'); two=imread('2.bmp');
three=imread('3.bmp');four=imread('4.bmp');
five=imread('5.bmp'); six=imread('6.bmp');
seven=imread('7.bmp');eight=imread('8.bmp');
nine=imread('9.bmp'); zero=imread('0.bmp');
zerofill=imread('fill0.bmp');
fourfill=imread('fill4.bmp');
sixfill=imread('fill6.bmp');
sixfill2=imread('fill6_2.bmp');
eightfill=imread('fill8.bmp');
ninefill=imread('fill9.bmp');
ninefill2=imread('fill9_2.bmp');
fillone=imread('1fill.jpg');
filltwo=imread('2fill.jpg');
fillfour=imread('4fill.jpg');
%*-*-*-*-*-*-*-*-*-*-*-
letter=[A Afill B Bfill C D Dfill E F G H I J K L M...
N O Ofill P Pfill Q Qfill R Rfill S T U V W X Y Z M1];
number=[one two three four fourfill five...
six sixfill sixfill2 seven eight eightfill nine ninefill ninefill2 zero zerofill fillone
filltwo fillfour];
character=[letter number];
NewTemplates=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]);
save ('NewTemplates','NewTemplates')
clear all
0 件のコメント
採用された回答
Image Analyst
2014 年 2 月 3 日
Well, since it says their sizes don't match for stitching together horizontally, what are the numbers of rows for all these: A Afill B Bfill C D Dfill E F G H I J K L M...
2 件のコメント
Walter Roberson
2014 年 2 月 4 日
I speculate that some of them are RGB (3 dimensional matrices) and some of them are not. You need to look at size() of each of them.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Behavior and Psychophysics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!