Create a Menu From Excel Data

10 ビュー (過去 30 日間)
Julie
Julie 2011 年 4 月 18 日
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 Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by