Regarding POLYFIT function in MATLAB
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Fangjun Jiang
2011-10-3
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!