{"id":514,"date":"2017-09-14T13:16:12","date_gmt":"2017-09-14T16:16:12","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=514"},"modified":"2017-09-14T13:16:12","modified_gmt":"2017-09-14T16:16:12","slug":"simp0-m","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/simp0-m\/","title":{"rendered":"simp0.m"},"content":{"rendered":"<pre>function q = simp0(y,h);\r\n% function simp0(y,h);     Simpson's 1\/3 quadrature rule - non-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\nsummat = 0;\r\nfor i = 2:2:n-1\r\n  summat = summat + 4 * y(i);\r\nend\r\nfor i = 3:2:n-2\r\n  summat = summat + 2 * y(i);\r\nend\r\nsummat = summat + y(1) + y(n);\r\n\r\nq = summat * h\/3;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>function q = simp0(y,h); % function simp0(y,h); Simpson&#8217;s 1\/3 quadrature rule &#8211; non-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-514","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/514","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=514"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/514\/revisions"}],"predecessor-version":[{"id":515,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/514\/revisions\/515"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}