The SIMPLE command doesn't seem to offer any way to return all the different forms of the symbolic expression as an output argument. It only returns the simplest one, and displays the rest in the Command Window.
If you want to avoid having to cut and paste from the Command Window, you can use this function I wrote, which makes use of the EVALC command (as suggested by Andrew Janke) to capture the output displayed in the Command Window:
function allEquations = simple_forms(S)
output = evalc('simple(S);'); %# Capture the output from the
%# Command Window
newlineIndex = find(output == char(10)); %# Get the indices of newlines
lineSizes = diff([0 newlineIndex]); %# Get the sizes of each line
output = mat2cell(output,1,lineSizes); %# Put the lines in a cell array
output = deblank(output); %# Remove blank spaces
emptyIndex = cellfun(@isempty,output); %# Find the indices of empty lines
output(emptyIndex) = []; %# Remove the empty lines
allEquations = output(2:2:end); %# Get the even lines (where the
%# formulae are)
allEquations = cellfun(@sym,allEquations,... %# Convert the formulae to
'UniformOutput',false); %# symbolic expressions
end
This function will return a cell array containing the symbolic forms of all the equations generated by SIMPLE. You just have to pick the one you want, like so:
>> eq1 = sym('sin(t)*cos(t)^2-sin(t)*cos(t)^4'); %# Create a symbolic equation
>> eqs = simple_forms(eq1); %# Get the different forms
>> eqs{1} %# Pick the first formula
ans =
sin(3*t)/16 - sin(5*t)/16 + sin(t)/8