MATLAB: If I use multi funcions with syms variable, How to get track min value among that funcions

MATLABSymbolic Math Toolbox

clear; clc; close all;
syms seta
Rx1= cos(seta)
Rx2= sin(seta)
If I set Rx1, Rx2 funcion like that, How can I get the graph with min value among Rx1, Rx2?
If I use discrete value, I can use like this
xmin=min([R1(x(:)');R2(x(:)');])
plot(x,xmin,'.-');
but, In this case I using Symbolic Math Toolbox, I don't know how I can make it works with syms variable…

Best Answer

You need to use something like
Min = @(tworows) arrayfun( @(colidx) piecewise(tworows(1,colidx) <= tworows(2,colidx), tworows(1,colidx), tworows(2,colidx)), 1:size(tworows,2);
The code could be simplified if you were willing to use R1 and R2 as separate arguments instead of putting them together in one array.