+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 2
    Points: 814, Level: 6

    Join Date
    Jan 2010
    Location
    India
    Posts
    52
    Helped
    1 / 1
    Points
    814
    Level
    6

    switch case in MATLAB

    Hai

    Every time I get an image, I need to compare it with a lot of existing images and take an appropriate decision. But, the 'elseif' statement makes it very slow. But I cant use switch case because the switch expression needs to be a scalar or string. How can I do my comparison in a faster way?

    Please help.

    Thanks

    •   Alt17th October 2010, 05:53

      advertising

        
       

  2. #2
    Advanced Member level 3
    Points: 9,408, Level: 23

    Join Date
    Oct 2008
    Location
    Sindh, Pakistan
    Posts
    895
    Helped
    180 / 180
    Points
    9,408
    Level
    23

    Re: switch case in MATLAB

    need more details, how do you compare, by correlation algorithm with scalar result or vector result or someother method



    •   Alt17th October 2010, 12:06

      advertising

        
       

  3. #3
    Member level 2
    Points: 814, Level: 6

    Join Date
    Jan 2010
    Location
    India
    Posts
    52
    Helped
    1 / 1
    Points
    814
    Level
    6

    Re: switch case in MATLAB

    I am just using the following commands:

    eg;

    a=imread('abc.jpg');
    b=imread('xyz.jpg');
    .
    .
    .
    .

    new=imread('New_Image.jpg');

    %the following code is for comparison (which I like to do with switch case)

    if(new==a)
    .......
    elseif(new==b)
    .......
    .
    .
    .
    .
    end;

    can I do this with switch statement?

    Thanks



--[[ ]]--