Create a Menu From Excel Data

10 Ansichten (letzte 30 Tage)
Julie
Julie am 18 Apr. 2011
Is there a way in which you can create a menu that will take text strings from an Excel file and place them as the options for the menu, and if so how do I do that?

Akzeptierte Antwort

Laura Proctor
Laura Proctor am 18 Apr. 2011
You can read the strings from the cells using XLSREAD, then use MENU to create the menu.
For example:
[num,txt,raw] = xlsread('myfile.xls');
choice = menu('Choose an item',txt)
  3 Kommentare
Laura Proctor
Laura Proctor am 19 Apr. 2011
In that case, you can just use:
choice = menu('Choose an item',txt(2:end))
Or, redefine txt and use the same syntax as above:
txt = txt(2:end)
Julie
Julie am 27 Apr. 2011
I am now trying to do the same thing with numerical values, but I cannot get it to work. Do I have to do something different?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by