You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to yal...@googlegroups.com
Hi,
I have a polynomial generated in Matlab using the polyfit command. I want to convert this polynomial as a sdpvar polynomial. Any way how I can do that?
Thanks,
-Paras
Johan Löfberg
unread,
Apr 9, 2015, 12:53:04 PM4/9/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to yal...@googlegroups.com
No direct command, but with the coefficients, it is just straightforward coding, vectorized or what ever you want to do
X =0:0.1:1;Y = sin(X); c = polyfit(X,Y,3); p = fliplr(c)*monolist(x,3); p = c*(x.^(3:-1:0)'); p = 0;for i = 0:3;p = p + c(i+1)*x.^(3-i);end sdisplay(p) -0.000133237237+1.0042*x-0.0188*x^2-0.1440*x^3
Mark L. Stone
unread,
Apr 9, 2015, 4:23:16 PM4/9/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to yal...@googlegroups.com
You have a typo in the final method. Should be c(i+1), not c(i) .
Johan Löfberg
unread,
Apr 10, 2015, 1:19:30 AM4/10/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message