【问题标题】:matlab draw a line using user input valuesmatlab使用用户输入值画一条线
【发布时间】:2016-12-04 23:05:34
【问题描述】:

我想使用来自 gui 编辑文本框中的值 x1,y1 和 x2,y2 的输入画一条线,并将它们绘制在轴上。

function

【问题讨论】:

  • 请勿将代码作为图片发布!!!!!

标签: matlab user-interface plot matlab-figure


【解决方案1】:

您正在尝试将图形句柄 本身转换为数字,而不是将uicontrol内容 转换为数字。要获取该值,您需要改用uicontrol'String' 属性。

x1 = str2double(get(handles.edit1, 'String'));

您将希望对所有用户提供的值执行相同的操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-28
    • 1970-01-01
    • 2019-02-06
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 2014-12-27
    相关资源
    最近更新 更多