I have a function that is a family of similar but different functions. An example would be 1*sin(1*x) and 2*sin(2*x). I have computed special points (the minimum) of this family of equations. I would like to be able to evaluate each equation within the family at the special point for that specific equation. When I try, I get a n-by-n sym array, because Matlab evaluates each equation at the special point for each equation, instead of evaluating each equation at the special point of that equation.
In slightly less abstract terms, I'm attempting to calculate the trajectory of a rocket, and I have a family of acceleration curves (in type symfun) that differ only in the time to reach a certain altitude. The function that provides the acceleration family of curves also provides a vector of the time at which the accel is at it's minimum. When I try to evaluate the accel curve family at the (vector valued) minimum accel time, I end up with a 1x6 cell, each of which consists of a 1x6 sym.
Is there some way to call my acceleration function with the (vector valued) min accel time in a single line or command? I've even tried to make an empty vector of the appropriate size and fill in each value individually, but I haven't been able to get anywhere.
Example code:
[a_v, v_v, p_v, t_ascent, t_flip, t_max_decel] = rocketLibrary.getLinearCurves(targetAltitude, a_y_0, true, [0.75 0.85 0.95 1.05 1.15 1.25])
maxDecel = zeros(1, length(t_max_decel))
for i = 1:length(t_max_decel)
maxDecel(1, i) = a_v((double(t_max_decel(i))))(i)