<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152090</link>
    <title>MATLAB Central Newsreader - Variable addresses?</title>
    <description>Feed for thread: Variable addresses?</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>Wed, 11 Jul 2007 15:24:03 -0400</pubDate>
      <title>Variable addresses?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152090#382334</link>
      <author>Eric </author>
      <description>Hello - &lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Is it possible to get Matlab to display the hexadecimal address of Workspace variables?  I'm teaching Matlab programming to mathematical biology students, and since they have no programming experience at all, I would like to show them exactly what's happening when they create/initialize variables.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thanks in advance.&lt;br&gt;
&lt;br&gt;
Eric</description>
    </item>
    <item>
      <pubDate>Wed, 11 Jul 2007 17:35:33 -0400</pubDate>
      <title>Re: Variable addresses?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152090#382337</link>
      <author>Michael Wild</author>
      <description>Eric wrote:&lt;br&gt;
&amp;gt; Hello - &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;     Is it possible to get Matlab to display the hexadecimal address of Workspace variables?  I'm teaching Matlab programming to mathematical biology students, and since they have no programming experience at all, I would like to show them exactly what's happening when they create/initialize variables.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;     Thanks in advance.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Eric&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
format debug&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
but i'm not sure this is something they will/can appreciate ;-)&lt;br&gt;
&lt;br&gt;
michael</description>
    </item>
    <item>
      <pubDate>Tue, 17 Jul 2007 12:29:14 -0400</pubDate>
      <title>Re: Variable addresses?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152090#383373</link>
      <author>Peter Boettcher</author>
      <description>&quot;Eric &quot; &amp;lt;toolson@unm.edu&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; Hello - &lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;     Is it possible to get Matlab to display the hexadecimal address&lt;br&gt;
&amp;gt;     of Workspace variables?  I'm teaching Matlab programming to&lt;br&gt;
&amp;gt;     mathematical biology students, and since they have no&lt;br&gt;
&amp;gt;     programming experience at all, I would like to show them exactly&lt;br&gt;
&amp;gt;     what's happening when they create/initialize variables.&lt;br&gt;
&lt;br&gt;
Hex addresses have more to do with the implementation of MATLAB and&lt;br&gt;
not the semantics of the language.  True, it is important to be&lt;br&gt;
familiar with levels of abstraction lower than the level you're&lt;br&gt;
programming in, but it's hardly the place to start for beginning&lt;br&gt;
programmers... I would stick with the behavior/semantics of the MATLAB&lt;br&gt;
language for the base.&lt;br&gt;
&lt;br&gt;
Image teaching C programming, and in the first semester explaining how&lt;br&gt;
malloc works: C library, brk() system call, page faults, difference&lt;br&gt;
between virtual/kernel/physical memory addresses, modification of the&lt;br&gt;
hardware page table, etc.  A partial taste of all this stuff is&lt;br&gt;
probably worse than a simple model for how malloc behaves, followed by&lt;br&gt;
a later class in operating systems.&lt;br&gt;
&lt;br&gt;
Just my (NS)HO&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
    <item>
      <pubDate>Sat, 21 Jul 2007 21:09:49 -0400</pubDate>
      <title>Re: Variable addresses?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152090#384166</link>
      <author>Yair Altman</author>
      <description>&amp;gt;&amp;gt; Is it possible to get Matlab to display the hexadecimal address of Workspace variables?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; format debug&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Michael - this is very interesting (and entirely undocumented) - thanks for sharing. Can you please elaborate on the entries displayed by this debug format (and perhaps other undocumented format options)?&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; pi&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
Structure address = 102ad690 &lt;br&gt;
m = 1           =&amp;gt; # rows&lt;br&gt;
n = 1           =&amp;gt; # cols&lt;br&gt;
pr = 11287160   =&amp;gt; OS/JVM thread id?&lt;br&gt;
pi = 0          =&amp;gt; ???&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.1416&lt;br&gt;
&lt;br&gt;
Yair Altman&lt;br&gt;
&lt;a href=&quot;http://www.ymasoftware.com&quot;&gt;http://www.ymasoftware.com&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 21 Jul 2007 21:32:53 -0400</pubDate>
      <title>Re: Variable addresses?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152090#384167</link>
      <author>Doug Schwarz</author>
      <description>In article &amp;lt;f7tsms$m4r$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;nbsp;&quot;Yair Altman&quot; &amp;lt;altmanyDEL@gmailDEL.comDEL&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Is it possible to get Matlab to display the hexadecimal address of &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Workspace variables?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; format debug&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Michael - this is very interesting (and entirely undocumented) - thanks for &lt;br&gt;
&amp;gt; sharing. Can you please elaborate on the entries displayed by this debug &lt;br&gt;
&amp;gt; format (and perhaps other undocumented format options)?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; pi&lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Structure address = 102ad690 &lt;br&gt;
&amp;gt; m = 1           =&amp;gt; # rows&lt;br&gt;
&amp;gt; n = 1           =&amp;gt; # cols&lt;br&gt;
&amp;gt; pr = 11287160   =&amp;gt; OS/JVM thread id?&lt;br&gt;
&amp;gt; pi = 0          =&amp;gt; ???&lt;br&gt;
&amp;gt;     3.1416&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yair Altman&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.ymasoftware.com&quot;&gt;http://www.ymasoftware.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
pr is just the pointer to the block of memory containing the real part &lt;br&gt;
of the array.  pi is the same for the imaginary part, 0 (null pointer) &lt;br&gt;
meaning that the array has no imaginary part.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Doug Schwarz&lt;br&gt;
dmschwarz&amp;ieee,org&lt;br&gt;
Make obvious changes to get real email address.</description>
    </item>
  </channel>
</rss>

