Загрузка данных


function pushbutton2_Callback(hObject, eventdata, handles)
    func_str = get(handles.edit1, 'String');
    a = str2double(get(handles.edit2, 'String'));
    b = str2double(get(handles.edit3, 'String'));
    
    f = str2func(['@(x)' func_str]);
    x = linspace(a, b, 500);
    y = f(x);
    
    axes(handles.axes1);
    plot(x, y, 'k-', 'LineWidth', 1.5);
    xlabel('X');
    ylabel('f(x)');
    grid on;
—————-
function pushbutton1_Callback(hObject, eventdata, handles)
    func_str = get(handles.edit1, 'String');
    a = str2double(get(handles.edit2, 'String'));
    b = str2double(get(handles.edit3, 'String'));
    
    f = str2func(['@(x)' func_str]);
    result = integral(f, a, b);
    
    set(handles.edit4, 'String', num2str(result, '%.4f'));