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);


    if( aveg(k)<= 10 )

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


  2. jcsd
  3. Jan 13, 2012 #2


    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....
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Similar Threads for Display output listbox
Mathematica Complex output from a real integral
Mathematica Storing Mathematica output
Mathematica DSolve output with unexpected parameters