<?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 Re: Vectorization works only for simple functions, not e.g. a Gaussian? in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038302#M219124</link>
    <description>&lt;P&gt;Stuart already explained the main problem: Don't type a square bracket unless you really want to create a matrix/vector.&lt;/P&gt;
&lt;P&gt;Here is your fixed&amp;nbsp; Prime 9 file attached&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1760392841716.png" style="width: 690px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/129675i782B4DF8D8A95429/image-dimensions/690x269?v=v2" width="690" height="269" role="button" title="Werner_E_0-1760392841716.png" alt="Werner_E_0-1760392841716.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would also suggest not to set the ORIGIN to an unusual value like -10 just to make it a little bit easier to create just one vector (f).&lt;/P&gt;
&lt;P&gt;I also would suggest to use the vector f itself when creating the vector S. Vectorization may be done automatically in case of the expression you are using but may not with other expressions. So its a good idea to always explicitly apply vectorization whenever a vector is used as argument in a scalar function - just to be on the safe side.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1760393092320.png" style="width: 888px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/129676i977D777BBC8C0E5C/image-dimensions/888x293?v=v2" width="888" height="293" role="button" title="Werner_E_1-1760393092320.png" alt="Werner_E_1-1760393092320.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Oct 2025 22:30:59 GMT</pubDate>
    <dc:creator>Werner_E</dc:creator>
    <dc:date>2025-10-13T22:30:59Z</dc:date>
    <item>
      <title>Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038291#M219122</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to fill a 1D array/vector with calculated scalar values. This works fine for a simple calculation; but for a more complicated calculation, it fills the vector with nested [1x1] arrays instead of scalars. I have tried to use Vectorize to fix this, but unsuccessfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As an example, I define an array index i = -mf::mf. A simple function f_sub_i = f0 + df*i works fine to set up a vector of frequencies f with uniform step size df. But now I try a Gaussian function S_sub_i = e^{-[(f_sub_i -f0)/sigma]^2} , and I get a vector of nested [1x1] arrays instead of scalars. How can I get a vector of scalar values calculated by the formula for S_sub_i?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm using MathCAD Prime 9.0.0.0&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 19:41:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038291#M219122</guid>
      <dc:creator>bbobbs</dc:creator>
      <dc:date>2025-10-13T19:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038298#M219123</link>
      <description>&lt;P&gt;Your exponent is a 1x1 matrix (or vector, depending upon your outlook).&amp;nbsp; Consequently, the result is a matrix.&amp;nbsp; Get rid of the bracket, and all is well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, I find the function unbox, and its counterpart box, to be helpful on several occasions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025 13 09 E.png" style="width: 659px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/129674i72C817210F46509E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2025 13 09 E.png" alt="2025 13 09 E.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I've got Mathcad Express 11, not Mathcad Prime 9, I'm afraid, so a worksheet wouldn't be much help to you).&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 21:00:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038298#M219123</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2025-10-13T21:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038302#M219124</link>
      <description>&lt;P&gt;Stuart already explained the main problem: Don't type a square bracket unless you really want to create a matrix/vector.&lt;/P&gt;
&lt;P&gt;Here is your fixed&amp;nbsp; Prime 9 file attached&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1760392841716.png" style="width: 690px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/129675i782B4DF8D8A95429/image-dimensions/690x269?v=v2" width="690" height="269" role="button" title="Werner_E_0-1760392841716.png" alt="Werner_E_0-1760392841716.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would also suggest not to set the ORIGIN to an unusual value like -10 just to make it a little bit easier to create just one vector (f).&lt;/P&gt;
&lt;P&gt;I also would suggest to use the vector f itself when creating the vector S. Vectorization may be done automatically in case of the expression you are using but may not with other expressions. So its a good idea to always explicitly apply vectorization whenever a vector is used as argument in a scalar function - just to be on the safe side.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1760393092320.png" style="width: 888px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/129676i977D777BBC8C0E5C/image-dimensions/888x293?v=v2" width="888" height="293" role="button" title="Werner_E_1-1760393092320.png" alt="Werner_E_1-1760393092320.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 22:30:59 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038302#M219124</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2025-10-13T22:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038303#M219125</link>
      <description>&lt;DIV&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Oct 2025 22:07:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038303#M219125</guid>
      <dc:creator>bbobbs</dc:creator>
      <dc:date>2025-10-13T22:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038304#M219126</link>
      <description>&lt;DIV&gt;&lt;P&gt;OMG, I’m so used to thinking that [brackets] are the same as (parentheses), just at a “higher level” of nesting. But of course you are right – brackets in MathCAD indicate an array, NOT like parentheses. Thank you so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Oct 2025 22:22:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1038304#M219126</guid>
      <dc:creator>bbobbs</dc:creator>
      <dc:date>2025-10-13T22:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1039606#M219209</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/269691"&gt;@bbobbs&lt;/a&gt;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to see if you got the help you needed.&lt;/P&gt;
&lt;P&gt;If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.&lt;BR /&gt;Of course, if you have more to share on your issue, please pursue the conversation. &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Anurag&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 08:31:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1039606#M219209</guid>
      <dc:creator>anursingh</dc:creator>
      <dc:date>2025-10-22T08:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Vectorization works only for simple functions, not e.g. a Gaussian?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1040633#M219274</link>
      <description>&lt;P&gt;Got it, thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 22:45:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Vectorization-works-only-for-simple-functions-not-e-g-a-Gaussian/m-p/1040633#M219274</guid>
      <dc:creator>bbobbs</dc:creator>
      <dc:date>2025-10-28T22:45:34Z</dc:date>
    </item>
  </channel>
</rss>

