How to compare two cell elements in matlab?

1 回表示 (過去 30 日間)
Monisha
Monisha 2014 年 4 月 12 日
回答済み: Azzi Abdelmalek 2014 年 4 月 12 日
I am using two cells for storing the targeted and the expected value of a neural network process in matlab. I have used two 1*1 cell array for storing the values respectively. And here is my code.
cinfo=cell(1,2)
cinfo(1,1)=iter(1,10)%value is retrieved from a dataset iter
cinfo(1,2)=iter(1,11)
amp1=cinfo(1,1);
amp2=cinfo(1,2);
if amp1 == amp2
message=sprintf('NOT DETECTED BY THE DISEASE');
uiwait(msgbox(message));
But when i run the above code, the get the following error :
??? Undefined function or method 'eq' for input arguments of type 'cell'.
Error in ==> comparison at line 38
if amp1 == amp2
How to solve this problem?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 4 月 12 日
Use curly brackets
amp1=cinfo{1,1};
amp2=cinfo{1,2};

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by