Regarding POLYFIT function in MATLAB
1 view (last 30 days)
Show older comments
k=1:1:100; a=log2(k);
p2 = polyfit(k,a,2);
{which create graph for all the values and make an 2nd order equation to represent that graph}
I get the answer like this...
p2 =
Columns 1 through 2
-0.000645220551355 0.106511608440816
Column 3
2.051917442148469
I want to access all three values separately...
Does anyone know any command or function or code for that....
for example Like
p2.1= -0.000645220551355
p2.2= 0.106511608440816
p2.3= 2.051917442148469
so in the next code if I want to use just 2nd value I can write x = p2.2*3 etc.
Thanks in advance...
0 Comments
Accepted Answer
Fangjun Jiang
on 3 Oct 2011
try
p2(1)
p2(2)
p2(3)
The "Getting Started" portion of the MATLAB documentation will be helpful for you. http://www.mathworks.com/help/techdoc/learn_matlab/f2-8955.html
More Answers (0)
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox 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!