Effacer les filtres
Effacer les filtres

How to create a .mat file

1 vue (au cours des 30 derniers jours)
ravi
ravi le 3 Fév 2014
Commenté : Walter Roberson le 4 Fév 2014
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

Réponse acceptée

Image Analyst
Image Analyst le 3 Fév 2014
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 commentaires
ravi
ravi le 4 Fév 2014
I am using same dimension (24x42) for all the images A Afill B Bfill C D Dfill E F G H I J K L M... but the same error is occurring at that time also.
Walter Roberson
Walter Roberson le 4 Fév 2014
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by