Hi everyone,
I'm trying to use a drop down menu in App Design to plot different channles from a .csv file. Essentially, it has a (time, fx,fy,fz) column structure. I have created the drop down menu button, and assigned Items and the corresponding values I want those items to have. However, I'm having trouble in the execution, as it seems that only one value is passed through properly, resulting in 2/3 graphs being completely broken. When I try to debug it by setting a different initial value, this is the error I get. I've researched it and there's not much info out there on how to fix it, especially since I'm seemengly doing a very simple thing. When I try to change the 'Value' from 2 to any other in the 'Items Data' list, I get the error.
The follwing is the UI component code generated by App Designer as well.
% Create AxisDropDownProcessing
app.AxisDropDownProcessing = uidropdown(app.PreprocessingTab);
app.AxisDropDownProcessing.Items = {'X', 'Y', 'Z'};
app.AxisDropDownProcessing.ItemsData = [2 3 4];
app.AxisDropDownProcessing.Editable = 'on';
app.AxisDropDownProcessing.ValueChangedFcn = createCallbackFcn(app, @AxisDropDownProcessingValueChanged, true);
app.AxisDropDownProcessing.BackgroundColor = [1 1 1];
app.AxisDropDownProcessing.Position = [67 648 50 22];
app.AxisDropDownProcessing.Value = 2;

 採用された回答

Cris LaPierre
Cris LaPierre 2022 年 4 月 22 日

0 投票

I see the same behavior. However, I could use the button with the vertical 3 dots to the right of the Value and Items fields to modify the default selection.

4 件のコメント

Dennis Premoli
Dennis Premoli 2022 年 4 月 22 日
Indeed. Might this be a bug in Matlab itself?
Cris LaPierre
Cris LaPierre 2022 年 4 月 22 日
After playing around some more, the issue may be with how the data is entered.
If I do not put my items in quotes, then I can change 'Value' property without using the popup and without getting an error message.
Dennis Premoli
Dennis Premoli 2022 年 5 月 9 日
It doesn't appear to work as seamlessly as perhaps it is eant to be but inputting them via the vertical 3 dot menu seems to bypass the issue.
Cris LaPierre
Cris LaPierre 2022 年 5 月 9 日
Remove the quotes around the Value and Items names, and it will work the way you expect.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Develop Apps Using App Designer についてさらに検索

製品

リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by