MATLAB - Using radio buttons to change units for a graph
<p>I am very new to Matlab and I am trying to create a GUI from an equation. I have to make it so I can change the units by clicking on radio buttons. </p>

<pre><code>T=MIN:10:MAX

P=10.^(A-B./(C+T));

        plot(T,P)
        xlabel('Temperature')
        ylabel('Pressure')
</code></pre>

<p>This is how I plot the graph and to input the constant for A, B, C, MIN and MAX, I did this.</p>

<pre><code>contents = cellstr(get(hObject,'String'));
popChoice = contents{get(hObject,'Value')};

if (strcmp(popChoice,'Acetic Acid'))
    A=8.021;
    B=1936.01;
    C=258.451;
    MIN=18
    MAX=118
</code></pre>

<p>and then</p>

<pre><code>assignin('base','A',A);
assignin('base','B',B);
assignin('base','C',C);
assignin('base','MIN',MIN);
assignin('base','MAX',MAX);
</code></pre>

<p>I did this for about 15 more compounds. Then I assigned the constants to the workspace. The graph works for all the compounds when I change them in the pop up menu but I don't know how to use the radio buttons to change the units of both T and P. I am very new to this. Thank you. </p>