Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I need to know what's the problem with this code

1 回表示 (過去 30 日間)
wisam kh
wisam kh 2018 年 9 月 2 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello I need to know what's the problem with this code
% tedata contain 20 cells
% trdata contain 60 cells
for j=1:length(tedata)
for i=1:length(trdata)
y=cell2mat(tedata(j));
x=cell2mat(trdata(i));
similarity = sqrt(sum((x - y) .^ 2));
if similarity>180
similarity=similarity-360;
elseif similarity<-180
similarity=similarity+360;
end
kk(i)=similarity;
end
[result indxofmin] =min(kk);
but it return the value of similarity at first step [similarity = sqrt(sum((x - y) .^ 2)); ] not after the condition
  4 件のコメント
Image Analyst
Image Analyst 2018 年 9 月 8 日
Another major problem with it is that there are not enough comments in it. That would not be acceptable in our company.
wisam kh
wisam kh 2018 年 9 月 10 日
Ok thank you.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by