How to find an unknown parameter from a equation fitted to a data-set in MATLAB 2016b ?
Show older comments
I have a data set for x values and y values.Now I want to solve an unknown parameter n from the equation y=2.t(1-cos(x)(n-1)/(n.p-p(1-cos(x))),where t,p are known.How to write the code to get value of n from the fitted plot? Thanks in advance
Accepted Answer
More Answers (1)
kowshik Thopalli
on 5 Mar 2017
0 votes
I might be wrong here. If you know all of these values and dont know only n cant you just find n through algebra. I mean solving for n from the equation you have given,I get n as n= ((1-cosx)*(p*y-2*t))/((p*y-2*t(1-cos(x))). and now implementing this in Matlab is trivial.
4 Comments
SANJIB MAJUMDER
on 5 Mar 2017
kowshik Thopalli
on 5 Mar 2017
I dont see the bigger picture. Why do you have to plot it? If you have only the plot but not x and y you can
h = findobj(gca,'Type','line')
x=get(h,'Xdata')
y=get(h,'Ydata')
do this to get the values of x and y from there you can solve this.
SANJIB MAJUMDER
on 5 Mar 2017
Edited: John D'Errico
on 5 Mar 2017
kowshik Thopalli
on 5 Mar 2017
Ofcourse.That is expected. As I mentioned in my comment earlier, the code that I gave is for getting data points if you have only the plot and no access to the data points. Since you have the data points this is an parameter estimation problem as pointed out by John
Categories
Find more on Linear Predictive Coding in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!