{"id":518,"date":"2017-09-14T13:16:48","date_gmt":"2017-09-14T16:16:48","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=518"},"modified":"2017-09-14T13:16:48","modified_gmt":"2017-09-14T16:16:48","slug":"simp2-m","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/simp2-m\/","title":{"rendered":"simp2.m"},"content":{"rendered":"<pre>function q = simp2(y,h);\r\n% function simp2(y,h);     Simpson's 1\/3 quadrature rule - vector version\r\n%\r\n%   input: y - function vector to be integrated\r\n%          h - interval width\r\n%  output: integral in the given region\r\n\r\nn = length(y);             % number of data points\r\nif (n\/2) == floor(n\/2)     % check to see if even (don't want this!)\r\n  fprintf('\\nError: must have odd number of data points\\n');\r\n  break;\r\nend\r\n\r\nq = h\/3 * (y(1) + 4 * sum(y(2:2:n-1)) + 2 * sum(y(3:2:n-2)) + y(n));\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>function q = simp2(y,h); % function simp2(y,h); Simpson&#8217;s 1\/3 quadrature rule &#8211; vector version % % input: y &#8211; function vector to be integrated % h &#8211; interval width % output: integral in the given region n = length(y); % number of data points if (n\/2) == floor(n\/2) % check to see if even (don&#8217;t [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-518","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=518"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/518\/revisions"}],"predecessor-version":[{"id":519,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/518\/revisions\/519"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}