MATLAB: Displaying a Value in a static text box

guiguide

Using GUI GUIDE what is the code to get an output from a equation/code that is in the GUI code, which is assigned to a variable, to display in a static text box.
More info: I have a GUI that grabs a set of data from an excel file with two columns and assigns one column to X and another to Y and then runs this through the Simpson 1/3 function in MATLAB and assigns that value to C. How do i get the variable C to display in the static Text box?

Best Answer

textLabel = sprintf('Variable C = %f', C);
set(handles.text1, 'String', textLabel);