MATLAB: Problem with GUI functions and obtain values from graph

functiongraphguiplotvalues from graph

Hello, I'm designing a GUI program in order to use it in a presentation, the GUI design and image is included as an attachment, also the graphs to be plotted are included. I want to calculate the value of S which is equals to (S=u0*u1*q*B/E). Where q, B and E are values entered by the user; u0 and u1 are two values that are obtained from a graph. u0 depends on D/B and u1 depends on H/B and L/B; where H and L are values entered by the user. So basically I want to enter the values of q,B,H,D and E. Then the GUI has to obtain the values of u0 and u1 corresponding to the given H/B and L/B. For example if D/B=2.5 then u0=0.9 and if H/B=100 and L/B=3 then u1=1.3 and then these values will be used to calculate S. I'm new to GUI so basically I have done nothing except putting the texts and push buttons. I need someone to help me with writing the functions in order to do this and mainly in obtaining the values from the graphs. Also I need help in plotting the graphs. Any help will be appreciated, my graduation depends on this presentation. Thanks in advance.

Best Answer

Putting the text and push buttons on the screen is the first step. the next step would be to generate a look-up table that you can used to get values from the graphs. Or if the graph is generated by an equation then you can insert the equation into the code to generate the values.
After that you can use the get() function to grab the values in your calculate callback function.
example: q=get(handles.editboxQ,'String'); q=str2num(q); %as editbox will be storing it as a string and not a number.
after you do that for each variable you can then do your math stuff and use the lookup table to generate your final result.