Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Display output in a listbox

  1. Jan 13, 2012 #1
    hi, i am facing some problem when i want to display several output in a listbox.

    i have a for loop to load the images from a folder, after the images loaded, it will gone through some calculation to get the average. if the images average <=10, then i want to display the images name in a listbox. when i have 5 images' average<=10, then i should display 5 images name in the list box. but now my problem is, the current output will keep replace the previous output.

    anyone can help me? here is some part of my code:

    sdirectory = 'D:\recognition system\database'; %specific the file directory
    filess = dir([sdirectory '/*.png']);
    for k = 1:length(filess)
    filename = [sdirectory '\' filess(k).name];
    I = imread(filename);

    ....
    aveg(k)=abs((standev/mean1)*100);

    if( aveg(k)<= 10 )


    newText=sprintf('the percentage of diffrence for <<%s>> is %0.0f \n ',filename,aveg(k));
    set(handles.listbox1,'String',newText);

    else

    set(handles.listbox1,'String','');
    end
    end
     
  2. jcsd
  3. Jan 13, 2012 #2

    jedishrfu

    Staff: Mentor

    well first question is what programming language are you using? is this matlab?
     
  4. Jan 13, 2012 #3
    yes, i am using matlab...
     
  5. Jan 14, 2012 #4
    anyone please....
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Display output in a listbox
Loading...