I want to plot with the value of an Edittext
Show older comments
Hi guys,
I'm currently working on a Guide, I have two Edittextboxes and two Pushbuttons. In the Edittextboxs I want to type in a value and plot some functions with one of the Pushbuttons. So I have to variables, in edittextbox input1 is x and in input2 is g. The range of g is between 0.1 and 1, but x is between 40 and 90.
I hope it's understandable. Thank you very much!
% --- Executes on button press in button1.
function button1_Callback(hObject, eventdata, handles)
% hObject handle to button1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x = str2num(char(get(handles.input1, 'String'))); %I want to get the edittext (input1)
y1=(0.02049/0.4)*x;
y2=(g*60./(1+(1.331./(sqrt(0.0631*x./(83.17-x))).^3)));
y3=(g*60./(1+(1.331./(sqrt(0.0631*x./(83.17-x))).^3)))-(0.02049/0.4)*x;
y4=(0.02049/0.4)*x-(g*60./(1+(1.331./(sqrt(0.0631*x./(83.17-x))).^3)));
plot(x,y1,'r','LineWidth',2)
hold on
plot(x,y2,'c','LineWidth',2)
plot(x,y3,'g','LineWidth',2)
plot(x,y4,'b', 'LineWidth',2 )
title('metabolisches Profil','FontSize', 15)
xlabel('VO2', 'FontSize', 15)
ylabel('dLak/dmin','FontSize', 15)
legend( 'func.1','func.3','func.4','func.5','FontSize', 12)
axis([0 100 0 5])
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!