Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
wisam kh
wisam kh le 2 Sep 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
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 commentaires
Image Analyst
Image Analyst le 8 Sep 2018
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 le 10 Sep 2018
Ok thank you.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by