Can I use the if else statement to classify garment?

조회 수: 1 (최근 30일)
junnie vix
junnie vix 2017년 11월 1일
답변: Eric 2017년 11월 1일
I am trying to find for a method to classify the classes of the garment(e.g:tops, pants,dress,skirts). Can I use the if else statement to do the classification?Hope to hear from your reply soon.Thanks
  댓글 수: 4
KSSV
KSSV 2017년 11월 1일
How your data is? What classification you want to do? More details needed for this.
junnie vix
junnie vix 2017년 11월 1일
Color, texture and pattern extraction

댓글을 달려면 로그인하십시오.

채택된 답변

Eric
Eric 2017년 11월 1일
I am going to assume your classifications are strings. As such, you can use strcmp() or any of its related functions, as such:
if strcmp(garment,'pants')
% Do something
end
Alternatively, you might be interested in a switch statement:
switch garment
case 'top'
% Do Something
case 'pants'
% Do Something
case 'dress'
% Do Something
otherwise
% Do Something (this case is optional)
end
It sounds like your use might be a little more involved though, such as being a structure or something. Both of the above would still apply. Just use strcmp(garment.color,'Red') or switch garment.texture, whatever fits your needs.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by