Put array in ListBox to choose different values for plot/ App Designer
显示 更早的评论
Hi,
I want to put all these values in the array G into my ListBox, but it doesn't show up.
My array "zR" has different sizes.
My purpose for the ListBox is to choose a number and show in my plot different lines. I am also open to other solutions besides the ListBox for my purpose.
Thank you in advance !
app.ListBox.Items=num2str(zR)
app.ListBox.ItemsData=num2str(zR)

回答(1 个)
Mario Malic
2020-12-10
Hello,
No need to assign ItemsData. Try this
app.ListBox.Items=num2str(zR(:))
4 个评论
Henry Tran
2020-12-10
编辑:Henry Tran
2020-12-10
Mario Malic
2020-12-10
As mentioned in the error 'Items' must be a 1-D cell array of character vectors or a string array.
Try this
app.ListBox.Items = mat2cell(a(:), ones(size(a)), 1)
Henry Tran
2020-12-12
Mario Malic
2020-12-12
Great that you've figured it out yourself!
类别
在 帮助中心 和 File Exchange 中查找有关 Pie Charts 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!