{"id":301,"date":"2008-08-26T08:36:28","date_gmt":"2008-08-26T13:36:28","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/2008\/08\/26\/puzzler-working-with-polynomials\/"},"modified":"2008-08-26T08:36:28","modified_gmt":"2008-08-26T13:36:28","slug":"puzzler-working-with-polynomials","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2008\/08\/26\/puzzler-working-with-polynomials\/","title":{"rendered":"Puzzler: Working with polynomials"},"content":{"rendered":"<p>This puzzler is very straightforward, so I hope to hear from some of the newer MATLAB users.  I think the solution is very linear, most people would come up with the same solution.  As a hint, be sure to look at our help for <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/polyder.html\">POLYDER<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/roots.html\">ROOTS<\/a>.<\/p>\n<p>The challenge is this:  Given the coefficients of two second order polynomials, find the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Maxima_and_minima\">local extrema<\/a> of the first one.  Knowing the X where this point happens, put a marker on both curves at that X value.  Plot both curves for three units to the left and right of the inflection point of the first curve.  [Edited Aug 27th in response to J. Paul R&#8217;s observation that I misused terminology, switching inflection point for local extrema.  MATLAB t-shirt for the catch.  Thank you!]<\/p>\n<p><img src='https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/inflect1.jpg' alt='inflect1.jpg' \/><\/p>\n<p>Here is the code to create the coefficients:<\/p>\n<pre>\n<code>\ncoef1 = rand(1,3)-0.5;\ncoef2 = rand(1,3)-0.5;\n<\/code>\n<\/pre>\n<pre><code>\n&lt;pre> &lt;code>\n\nall the code so someone can just copy and paste it from the comments.\n\n&lt;\/code> &lt;\/pre>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This puzzler is very straightforward, so I hope to hear from some of the newer MATLAB users.  I think the solution is very linear, most people would come up with the same solution.  As a hint, be&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2008\/08\/26\/puzzler-working-with-polynomials\/\">read more >><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17,10],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/301"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}