Create a Menu From Excel Data

10 次查看(过去 30 天)
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?

采纳的回答

Laura Proctor
Laura Proctor 2011-4-18
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 个评论
Laura Proctor
Laura Proctor 2011-4-19
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 2011-4-27
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?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by