error

1 回表示 (過去 30 日間)
piyari sadia
piyari sadia 2011 年 8 月 20 日
i m doing work on optical character recognition.........an error come in my code.....................Error is For colon operator with char operand , first and last operend must be char............. for i=1:cellsize

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 8 月 20 日
It sounds as if your variable named "cellsize" is of type char.
It is legal to have a statement such as
for i = 'J':'*'
and it is legal to have
for i = 54:112
but it is not legal to have a number on one side of the colon and a character on the other side of the colon.
I think it more likely than not that what you are trying to do is completely wrong, but in the meanwhile you can get around the immediate problem by using
for i = char(1):cellsize

カテゴリ

Help Center および File ExchangeSignal Attributes and Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by