Vpasolve higher polynomials does not give a real solution
Show older comments
equation_clean = poly2sym(p,t) %the equation of the polynomial interpolation
yvalues = polyval(p,a,[],mu); %yvalues of the linear interpolation
hold off
slope_graph = polyfit(a,yvalues,1);
T = yvalues(1:14);
stand_dev = std(T);
while stand_dev < .03
counter = counter + 1;
T(counter) = yvalues(counter);
stand_dev = std(T);
end
max_ind = find(a,1,'last');
ts_ind = find(yvalues == T(counter),1,'last');
ts = a(ts_ind);
Temperature2 = yvalues(max_ind:-1:ts_ind);
T_2 = Temperature2(1:14);
stand_dev = 0;
counter = 14;
while stand_dev < .03
counter = counter + 1;
T_2(counter) = Temperature2(counter);
stand_dev = std(T_2);
end
yH_ind = find( Temperature2 == T_2(counter),1,'last');
if slope_graph(1) > 0
yL = mean(T)
yH = Temperature2(yH_ind)
else
yL = Temperature2(yH_ind)
yH = mean(T)
end
y_tau = .632 * (yH - yL)
ts
x_tau_t = vpasolve(equation_clean == y_tau,t,[0 Inf])
tau = x_tau_t(end) - ts;
Hello everyone, I need your help.
I am super beginner at Matlab, but have a challenging task in front of me. I want to find out tau value, I calculatd ts and y_tau. Now I just need to plug in value for y_tau and determine x_tau from it. However matlab tells me that the number does not exist, so there is no solution. but when I draw the graph it is obvious that there is a positive interger solution which is close to 1.7 seconds. Any help would be much appreciated. I have used polynomial interpolation or polyval to determine the polynomial equation.
2 Comments
Walter Roberson
on 10 Apr 2019
We need to know what inputs to test with ?
Rufat Imanov
on 10 Apr 2019
Answers (1)
Walter Roberson
on 10 Apr 2019
0 votes
Q: "We need to know what inputs to test with ?"
A: "The inputs are given by the user"
Given that, then we can conclude that you are wrong about there being an error with the program. See attached implementation code.
3 Comments
Rufat Imanov
on 10 Apr 2019
Rufat Imanov
on 10 Apr 2019
Walter Roberson
on 10 Apr 2019
We do not have your x or your y, and we do not have your function selection_data
Categories
Find more on Interpolation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!