{"id":4427,"date":"2018-09-25T12:58:21","date_gmt":"2018-09-25T12:58:21","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=4427"},"modified":"2024-08-09T08:18:59","modified_gmt":"2024-08-09T08:18:59","slug":"plotting-data-with-octave","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/plotting-data-with-octave\/","title":{"rendered":"Plotting data with Octave"},"content":{"rendered":"<h2>Plotting data with Octave<\/h2>\n<p>In this tutorial, we will learn detailed steps to plot data using an Octave script.<\/p>\n<h3>Sample function<\/h3>\n<p>We can choose any function. Let&#8217;s choose a simple function y defined as:<\/p>\n<p>y= 1\/(x^2 + 1);<\/p>\n<p>Generate x vector with some sample points from 0 to 10.<\/p>\n<p>x=linspace(0,10,100);<\/p>\n<p>Calculate y vector.<\/p>\n<p>y= 1.\/(x.^2 + 1) ;<\/p>\n<h3>Steps to create Script<\/h3>\n<p>Launch Octave.<\/p>\n<p><strong>File &gt;&gt; New &gt;&gt; New Script<\/strong><\/p>\n<p><strong>File &gt;&gt; Save File<\/strong> to save the file.<\/p>\n<h3>Plot command<\/h3>\n<p>&nbsp;<\/p>\n<pre>%Plotting data using OCtave\r\n        x=linspace(0,10,100);\r\n\r\n        y= 1.\/(x.^2 + 1) ;\r\n\r\n        %Plot graph\r\n\r\n        figure\r\n\r\n        %plot command\r\n\r\n        plot(x,y,'ro','MarkerSize',30)\r\n\r\n        xlabel('x')\r\n\r\n        ylabel('y')\r\n\r\n        title('Sample Plot');<\/pre>\n<pre><\/pre>\n<h3>Screenshot<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4430\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Screenshot-from-2020-09-25-06-31-09.png\" alt=\"Plot data Octave\" width=\"1920\" height=\"1080\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Screenshot-from-2020-09-25-06-31-09.png 1920w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Screenshot-from-2020-09-25-06-31-09-300x169.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Screenshot-from-2020-09-25-06-31-09-1024x576.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Screenshot-from-2020-09-25-06-31-09-768x432.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Screenshot-from-2020-09-25-06-31-09-1536x864.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Octave Tutorial on this website can be found at:<br \/>\n<a href=\"https:\/\/www.testingdocs.com\/octave-tutorial\/\"><strong>https:\/\/www.testingdocs.com\/octave-tutorial\/<\/strong><\/a><\/p>\n<p>More information on Octave can be found on the official website:<br \/>\n<a href=\"https:\/\/www.gnu.org\/software\/octave\/index\" rel=\"noopener\">https:\/\/www.gnu.org\/software\/octave\/index<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plotting data with Octave In this tutorial, we will learn detailed steps to plot data using an Octave script. Sample function We can choose any function. Let&#8217;s choose a simple function y defined as: y= 1\/(x^2 + 1); Generate x vector with some sample points from 0 to 10. x=linspace(0,10,100); Calculate y vector. y= 1.\/(x.^2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-4427","post","type-post","status-publish","format-standard","hentry","category-octave","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=4427"}],"version-history":[{"count":8,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4427\/revisions"}],"predecessor-version":[{"id":23779,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4427\/revisions\/23779"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=4427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=4427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=4427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}