finding the percentage of concordance

4 views (last 30 days)
  • Hello, I want to calculate the percentage of image not presented to image is presented *
function ham_dis = rec_test(train,impostures)
ham_dis = [];
for g=1:5
for j=1:339
ham_dis(j,:)= sum(sum(abs(impostures(g,:)-train(j,:))));
if (ham_dis(j,:) < 7374)
disp('image is present');
else
disp('image not present');
end
end
end
end
thanks

Accepted Answer

Image Analyst
Image Analyst on 28 Mar 2015
I have no idea what "the percentage of image not presented to image is presented" means.
Is there a problem with your code? Can't you just count the number?
Before the loop
numberPresent = 0;
In the loop:
if (ham_dis(j,:) < 7374)
disp('image is present');
numberPresent = numberPresent + 1;
else
disp('image not present');
end
After the loop:
percentage = 100 * numberPresent / (5*339);
  3 Comments
Image Analyst
Image Analyst on 28 Mar 2015
My code computes that percentage. The percentage more than 7374 is just (100-percentage).

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!