<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252129</link>
    <title>MATLAB Central Newsreader - Delayed Unit Step (Heaviside) Function on Matlab</title>
    <description>Feed for thread: Delayed Unit Step (Heaviside) Function on Matlab</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 25 May 2009 10:00:04 -0400</pubDate>
      <title>Delayed Unit Step (Heaviside) Function on Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252129#652194</link>
      <author>Kola Ogidi</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I'm trying to create a variable which holds a delayed unit step function which starts at 64 (rather than the normal unit step function which starts at 0).  I named this variable Heavisidesixtyfour and used the following statement to try to implement it:&lt;br&gt;
&lt;br&gt;
heavisidesixtyfour=(t&amp;gt;=64);&lt;br&gt;
&lt;br&gt;
I also set the value at 63 (taking into account a problem I encountered recently which was resolved by including 0 time in my count).  However, I am getting the following error message whichever way I try to run it:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; mtimes&lt;br&gt;
Inner matrix dimensions must agree.&lt;br&gt;
&lt;br&gt;
I had previously created the normal unit step function as follows:&lt;br&gt;
&lt;br&gt;
heaviside=(t&amp;gt;=0);&lt;br&gt;
&lt;br&gt;
This worked ok but I'm not sure if this might have to do with the problem I'm encountering.  Could you please advise me on what I need to do to achieve my aim.&lt;br&gt;
&lt;br&gt;
Thanks in advance.&lt;br&gt;
Kola </description>
    </item>
    <item>
      <pubDate>Mon, 25 May 2009 15:39:02 -0400</pubDate>
      <title>Re: Delayed Unit Step (Heaviside) Function on Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252129#652263</link>
      <author>Sadik </author>
      <description>Hi Kola,&lt;br&gt;
&lt;br&gt;
heavisidesixtyfour=(t&amp;gt;=64);&lt;br&gt;
&lt;br&gt;
can never give such an error because you are not doing any multiplication. The problem might be somewhere else. I believe, transposing t should solve the problem. So you would say:&lt;br&gt;
&lt;br&gt;
heavisidesixtyfour=(t'&amp;gt;=64);&lt;br&gt;
&lt;br&gt;
&quot;Kola Ogidi&quot; &amp;lt;kko_ogidi@yahoo.co.uk&amp;gt; wrote in message &amp;lt;gvdq74$6mf$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm trying to create a variable which holds a delayed unit step function which starts at 64 (rather than the normal unit step function which starts at 0).  I named this variable Heavisidesixtyfour and used the following statement to try to implement it:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; heavisidesixtyfour=(t&amp;gt;=64);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I also set the value at 63 (taking into account a problem I encountered recently which was resolved by including 0 time in my count).  However, I am getting the following error message whichever way I try to run it:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; mtimes&lt;br&gt;
&amp;gt; Inner matrix dimensions must agree.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I had previously created the normal unit step function as follows:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; heaviside=(t&amp;gt;=0);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This worked ok but I'm not sure if this might have to do with the problem I'm encountering.  Could you please advise me on what I need to do to achieve my aim.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&amp;gt; Kola </description>
    </item>
    <item>
      <pubDate>Mon, 25 May 2009 16:12:36 -0400</pubDate>
      <title>Re: Delayed Unit Step (Heaviside) Function on Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/252129#652273</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Kola Ogidi&quot; &amp;lt;kko_ogidi@yahoo.co.uk&amp;gt; wrote in message &lt;br&gt;
news:gvdq74$6mf$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'm trying to create a variable which holds a delayed unit step function &lt;br&gt;
&amp;gt; which starts at 64 (rather than the normal unit step function which starts &lt;br&gt;
&amp;gt; at 0).  I named this variable Heavisidesixtyfour and used the following &lt;br&gt;
&amp;gt; statement to try to implement it:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; heavisidesixtyfour=(t&amp;gt;=64);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I also set the value at 63 (taking into account a problem I encountered &lt;br&gt;
&amp;gt; recently which was resolved by including 0 time in my count).  However, I &lt;br&gt;
&amp;gt; am getting the following error message whichever way I try to run it:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; mtimes&lt;br&gt;
&amp;gt; Inner matrix dimensions must agree.&lt;br&gt;
&lt;br&gt;
Note that * won't work to compute t*heavisidesixtyfour -- that's matrix &lt;br&gt;
multiplication, not elementwise multiplication (.*) which is what I think &lt;br&gt;
you want.&lt;br&gt;
&lt;br&gt;
In this case, though, if you wanted to compute the Heaviside function on &lt;br&gt;
multiple vectors, I'd create a function (or an anonymous function) that &lt;br&gt;
accepts t and returns the desired vector.&lt;br&gt;
&lt;br&gt;
function y = heavisideN(t, N)&lt;br&gt;
y = (t &amp;gt;= N);&lt;br&gt;
&lt;br&gt;
% or&lt;br&gt;
heavisideN = @(t, N) (t&amp;gt;= N);&lt;br&gt;
&lt;br&gt;
Then use that function:&lt;br&gt;
&lt;br&gt;
t = 0:100;&lt;br&gt;
y = t .* heavisideN(t, 63); % Note the use of .* instead of *&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
  </channel>
</rss>

