<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Generating numbers with given stepsize and range in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38798#M183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is an easy job if the gap between the first number and the last is a multiple of the step size; however, I want to do it in more general cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I want to generate a seris starting from 1 until 45 while the value increases by 4 each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In matlab, we can type 1:4:45 and it gives [1 5 9 ... 41 45];&amp;nbsp; If I write 2:4:45, it will give [2 6 10 ... 42]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can write a loop in SAS, but it could be increase the computation time dramatically. Is there an easier way to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jan 2012 16:01:07 GMT</pubDate>
    <dc:creator>bigbigben</dc:creator>
    <dc:date>2012-01-26T16:01:07Z</dc:date>
    <item>
      <title>Generating numbers with given stepsize and range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38798#M183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is an easy job if the gap between the first number and the last is a multiple of the step size; however, I want to do it in more general cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I want to generate a seris starting from 1 until 45 while the value increases by 4 each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In matlab, we can type 1:4:45 and it gives [1 5 9 ... 41 45];&amp;nbsp; If I write 2:4:45, it will give [2 6 10 ... 42]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can write a loop in SAS, but it could be increase the computation time dramatically. Is there an easier way to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 16:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38798#M183</guid>
      <dc:creator>bigbigben</dc:creator>
      <dc:date>2012-01-26T16:01:07Z</dc:date>
    </item>
    <item>
      <title>Generating numbers with given stepsize and range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38799#M184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The matlab syntax is NSTART: INCR: NSTOP. You can do the same in SAS/IML by using the DO function:&lt;/P&gt;&lt;P&gt;x = do( nstart, nstop, incr);&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;x = do( 1, 45, 4);&lt;/P&gt;&lt;P&gt;y = do( 2, 45, 4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more on this topic (including the SAS/IML equivalent of the linspace() function in MATLAB), see &lt;A href="http://blogs.sas.com/content/iml/2011/01/10/creating-vectors-that-contain-evenly-spaced-values/"&gt;http://blogs.sas.com/content/iml/2011/01/10/creating-vectors-that-contain-evenly-spaced-values/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you need to generate points on a 2D grid, see &lt;A href="http://blogs.sas.com/content/iml/2011/01/21/how-to-create-a-grid-of-values/"&gt;http://blogs.sas.com/content/iml/2011/01/21/how-to-create-a-grid-of-values/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 16:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38799#M184</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-01-26T16:15:34Z</dc:date>
    </item>
    <item>
      <title>Generating numbers with given stepsize and range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38800#M185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC IML;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = DO(2,45,4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT i;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of the questions you are asking on the SAS/IML forum are rather basic. May I suggest that you buy (or borrow) Rick's book to properly learn IML from scratch?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 16:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38800#M185</guid>
      <dc:creator>TomTom</dc:creator>
      <dc:date>2012-01-26T16:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generating numbers with given stepsize and range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38801#M186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Questions at all levels are welcome. It is often difficult for a beginner to get started, especially when you are coming from another language like MATLAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TomTom correct mentions that there are some resources that might help you with the learning curve:&lt;/P&gt;&lt;P&gt;- the &lt;A href="http://blogs.sas.com/content/iml/2011/10/10/sasiml-tip-sheets/"&gt;SAS/IML Tip sheet&lt;/A&gt; &lt;/P&gt;&lt;P&gt;- a short (and not complete) "&lt;A href="http://blogs.sas.com/content/iml/2011/03/09/translating-a-matlab-program-into-the-sasiml-language-a-case-study/"&gt;MATLAB to SAS/IML Tip Sheet&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;- the &lt;A href="http://blogs.sas.com/content/iml/2010/11/15/free-chapter-getting-started-with-sasiml/"&gt;FREE chapter of my book&lt;/A&gt; [HIGHLY RECOMMENDED]&lt;/P&gt;&lt;P&gt;- Read the article "&lt;A href="http://blogs.sas.com/content/iml/2011/05/09/how-to-learn-sasiml-five-resources-for-the-beginner/"&gt;How to learn SAS/IML: Five resources for the beginner&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the "How to learn SAS/IML" article, the 3rd suggestion is "ask questions at the SAS/IML discussion forum"! So (IMHO), feel free to ask for help when you get stuck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 16:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38801#M186</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-01-26T16:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generating numbers with given stepsize and range</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38802#M187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick and TomTom. Many thanks for your response and help. I used Matlab pretty often before, and there are tons of sample codes of user-defined functions online that I can borrow or use as references. It is not very easy to find such resources in SAS. As my defense, even I read Rick's book, I probably don't remember all the functions used in SAS/IML. That being said, I will read all the documents recommended by both of you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best wishes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 16:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Generating-numbers-with-given-stepsize-and-range/m-p/38802#M187</guid>
      <dc:creator>bigbigben</dc:creator>
      <dc:date>2012-01-26T16:38:28Z</dc:date>
    </item>
  </channel>
</rss>

