<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Changing Matlab&#039;s Command Window colors	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=changing-matlab-command-window-colors</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 23 Sep 2020 08:26:51 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-508909</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 23 Sep 2020 08:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-508909</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-508903&quot;&gt;Sunki Reddy Gunugu&lt;/a&gt;.

There is no direct way to replicate the CW in a GUI window, you&#039;ll need to display the text in the GUI using your program logic. 
Here is one possible implementation that could assist you: http://undocumentedmatlab.com/articles/rich-contents-log-panel]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-508903">Sunki Reddy Gunugu</a>.</p>
<p>There is no direct way to replicate the CW in a GUI window, you&#8217;ll need to display the text in the GUI using your program logic.<br />
Here is one possible implementation that could assist you: <a href="http://undocumentedmatlab.com/articles/rich-contents-log-panel" rel="ugc">http://undocumentedmatlab.com/articles/rich-contents-log-panel</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sunki Reddy Gunugu		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-508903</link>

		<dc:creator><![CDATA[Sunki Reddy Gunugu]]></dc:creator>
		<pubDate>Mon, 21 Sep 2020 10:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-508903</guid>

					<description><![CDATA[hi 
1.i would like to know how the error in command window of matlab is captured and displayed in the GUI with the same color in CW
2. Is their any way to replicate the exact CW stuff with same colors and font in the GUI.]]></description>
			<content:encoded><![CDATA[<p>hi<br />
1.i would like to know how the error in command window of matlab is captured and displayed in the GUI with the same color in CW<br />
2. Is their any way to replicate the exact CW stuff with same colors and font in the GUI.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-369178</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 04 Feb 2016 20:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-369178</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-363268&quot;&gt;ale&lt;/a&gt;.

@Ale - First, did you really expect some undocumented functionality that I wrote about back in 2009 to continue working in 2015 ?! Be realistic!

Secondly, it turns out that somewhere along the years the required JTextArea handle moved from being stored in listeners(3) to listeners(4) (read the comments above!) and then listeners(5).

In short, you can&#039;t expect undocumented features to remain exactly as-is, unchanged, for so many years. At the very least you need to invest a bit of effort to check around and see maybe only a small thing has changed (as in this case). And in any case, you need to spend the time to at least read other peoples&#039; comments to see whether they answer your question.

Nothing personal :-)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-363268">ale</a>.</p>
<p>@Ale &#8211; First, did you really expect some undocumented functionality that I wrote about back in 2009 to continue working in 2015 ?! Be realistic!</p>
<p>Secondly, it turns out that somewhere along the years the required JTextArea handle moved from being stored in listeners(3) to listeners(4) (read the comments above!) and then listeners(5).</p>
<p>In short, you can&#8217;t expect undocumented features to remain exactly as-is, unchanged, for so many years. At the very least you need to invest a bit of effort to check around and see maybe only a small thing has changed (as in this case). And in any case, you need to spend the time to at least read other peoples&#8217; comments to see whether they answer your question.</p>
<p>Nothing personal 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ale		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-363268</link>

		<dc:creator><![CDATA[ale]]></dc:creator>
		<pubDate>Fri, 04 Dec 2015 11:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-363268</guid>

					<description><![CDATA[Unfortunately, this doesn&#039;t work on matlab R2015a. I often have many matlab sessions open at the same time and I usually change the title using a free windows utility, but sometimes that is not enough. Changing the background color of different matlab sessions can save potential disasters!

If I try any of the proposed commands, I get:
&lt;pre lang=&quot;matlab&quot;&gt;
set(jTextArea,&#039;Background&#039;,&#039;yellow&#039;);
Error using set
The name &#039;Background&#039; is not an accessible property for an
instance of class &#039;com.mathworks.mde.cmdwin.CmdWinUndoManager&#039;.
&lt;/pre&gt;

These are the properties of the object:
&lt;pre lang=&quot;matlab&quot;&gt;
get(jTextArea)
                         Class: [1x1 java.lang.Class]
                    InProgress: 1
                         Limit: 100
              PresentationName: &#039;&#039;
          RedoPresentationName: &#039;Redo&#039;
                   Significant: 0
    UndoOrRedoPresentationName: &#039;Undo&#039;
          UndoPresentationName: &#039;Undo&#039;
&lt;/pre&gt;

and these are the methods:
&lt;pre lang=&quot;matlab&quot;&gt;
methods(jTextArea)

Methods for class com.mathworks.mde.cmdwin.CmdWinUndoManager:

addEdit                        insertUpdate                   
canRedo                        isInProgress                   
canUndo                        isSignificant                  
canUndoOrRedo                  notify                         
changedUpdate                  notifyAll                      
die                            redo                           
discardAllEdits                removeUpdate                   
end                            replaceEdit                    
equals                         setLimit                       
getClass                       toString                       
getLimit                       undo                           
getPresentationName            undoOrRedo                     
getRedoPresentationName        undoableEditHappened           
getUndoOrRedoPresentationName  wait                           
getUndoPresentationName        
hashCode        
&lt;/pre&gt;

Is there any way to do the same on this matlab version?
Thank you for your precious work.]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, this doesn&#8217;t work on matlab R2015a. I often have many matlab sessions open at the same time and I usually change the title using a free windows utility, but sometimes that is not enough. Changing the background color of different matlab sessions can save potential disasters!</p>
<p>If I try any of the proposed commands, I get:</p>
<pre lang="matlab">
set(jTextArea,'Background','yellow');
Error using set
The name 'Background' is not an accessible property for an
instance of class 'com.mathworks.mde.cmdwin.CmdWinUndoManager'.
</pre>
<p>These are the properties of the object:</p>
<pre lang="matlab">
get(jTextArea)
                         Class: [1x1 java.lang.Class]
                    InProgress: 1
                         Limit: 100
              PresentationName: ''
          RedoPresentationName: 'Redo'
                   Significant: 0
    UndoOrRedoPresentationName: 'Undo'
          UndoPresentationName: 'Undo'
</pre>
<p>and these are the methods:</p>
<pre lang="matlab">
methods(jTextArea)

Methods for class com.mathworks.mde.cmdwin.CmdWinUndoManager:

addEdit                        insertUpdate                   
canRedo                        isInProgress                   
canUndo                        isSignificant                  
canUndoOrRedo                  notify                         
changedUpdate                  notifyAll                      
die                            redo                           
discardAllEdits                removeUpdate                   
end                            replaceEdit                    
equals                         setLimit                       
getClass                       toString                       
getLimit                       undo                           
getPresentationName            undoOrRedo                     
getRedoPresentationName        undoableEditHappened           
getUndoOrRedoPresentationName  wait                           
getUndoPresentationName        
hashCode        
</pre>
<p>Is there any way to do the same on this matlab version?<br />
Thank you for your precious work.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-324806</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 13 May 2014 20:28:15 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-324806</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-324780&quot;&gt;lea&lt;/a&gt;.

@Lea - you can do it by accessing the Command Window&#039;s &lt;code&gt;XCmdWndView&lt;/code&gt; component, which is basically just a Java Swing &lt;code&gt;JTextArea&lt;/code&gt; with a few Matlab customizations. You can get started in &lt;a href=&quot;http://undocumentedmatlab.com/blog/cprintf-display-formatted-color-text-in-command-window&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;this article describing my &lt;i&gt;&lt;b&gt;cprintf&lt;/b&gt;&lt;/i&gt; utility&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-324780">lea</a>.</p>
<p>@Lea &#8211; you can do it by accessing the Command Window&#8217;s <code>XCmdWndView</code> component, which is basically just a Java Swing <code>JTextArea</code> with a few Matlab customizations. You can get started in <a href="http://undocumentedmatlab.com/blog/cprintf-display-formatted-color-text-in-command-window" target="_blank" rel="nofollow">this article describing my <i><b>cprintf</b></i> utility</a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: lea		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-324780</link>

		<dc:creator><![CDATA[lea]]></dc:creator>
		<pubDate>Tue, 13 May 2014 08:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-324780</guid>

					<description><![CDATA[Hi Yair,

Kudos for the great blog!
I wonder if there&#039;s a way to manipulate the already printed text in the command pane. Could be useful for &#039;realtime&#039; text animation (progress indication).

p.s. Beside the obvious solution to manipulate the line with control characters… I mean lines from previous prints.

10x,
Lea]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>Kudos for the great blog!<br />
I wonder if there&#8217;s a way to manipulate the already printed text in the command pane. Could be useful for &#8216;realtime&#8217; text animation (progress indication).</p>
<p>p.s. Beside the obvious solution to manipulate the line with control characters… I mean lines from previous prints.</p>
<p>10x,<br />
Lea</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-309407</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 14 Jan 2014 23:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-309407</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-293534&quot;&gt;cariacou&lt;/a&gt;.

Here is another method that I just found:

&lt;pre lang=&quot;matlab&quot;&gt;
rows = builtin(&#039;_getcmdwinrows&#039;);
cols = builtin(&#039;_getcmdwincols&#039;);
&lt;/pre&gt;

These built-in functions are defined in &lt;i&gt;%matlabroot%/bin/registry/libmwservices.xml&lt;/i&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-293534">cariacou</a>.</p>
<p>Here is another method that I just found:</p>
<pre lang="matlab">
rows = builtin('_getcmdwinrows');
cols = builtin('_getcmdwincols');
</pre>
<p>These built-in functions are defined in <i>%matlabroot%/bin/registry/libmwservices.xml</i></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-294030</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 10 Nov 2013 08:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-294030</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-293534&quot;&gt;cariacou&lt;/a&gt;.

@Cariacou - yes, here&#039;s how:

&lt;pre lang=&quot;matlab&quot;&gt;
% Get the Command Window&#039;s text-area reference
cmdWinDoc = com.mathworks.mde.cmdwin.CmdWinDocument.getInstance;
listeners = cmdWinDoc.getDocumentListeners;
jTextArea = listeners(4);  % this could be listeners(3) in some Matlabs - check your specific case!

% Get the containing viewport&#039;s visible window width
visibleWidth = jTextArea.getAccessibleParent.getVisibleRect.getWidth;

% Divide by the character width (assume monospace font)
font = jTextArea.getFont;
charWidth = jTextArea.getFontMetrics(font).stringWidth(&#039;m&#039;);
numChars = visibleWidth / charWidth;
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-293534">cariacou</a>.</p>
<p>@Cariacou &#8211; yes, here&#8217;s how:</p>
<pre lang="matlab">
% Get the Command Window's text-area reference
cmdWinDoc = com.mathworks.mde.cmdwin.CmdWinDocument.getInstance;
listeners = cmdWinDoc.getDocumentListeners;
jTextArea = listeners(4);  % this could be listeners(3) in some Matlabs - check your specific case!

% Get the containing viewport's visible window width
visibleWidth = jTextArea.getAccessibleParent.getVisibleRect.getWidth;

% Divide by the character width (assume monospace font)
font = jTextArea.getFont;
charWidth = jTextArea.getFontMetrics(font).stringWidth('m');
numChars = visibleWidth / charWidth;
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: cariacou		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-293534</link>

		<dc:creator><![CDATA[cariacou]]></dc:creator>
		<pubDate>Fri, 08 Nov 2013 19:59:47 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-293534</guid>

					<description><![CDATA[Hi Yair.

I was reading through this post and tried to find a few attributes of the command window that I could use to personalize my programm but couldn&#039;t find them.

do you know by chance how to get the size of the command window ?
I would like to use the number of characters that can be displayed without having to slide left and right.

thanks !]]></description>
			<content:encoded><![CDATA[<p>Hi Yair.</p>
<p>I was reading through this post and tried to find a few attributes of the command window that I could use to personalize my programm but couldn&#8217;t find them.</p>
<p>do you know by chance how to get the size of the command window ?<br />
I would like to use the number of characters that can be displayed without having to slide left and right.</p>
<p>thanks !</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-197926</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 04 May 2013 17:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3#comment-197926</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-197570&quot;&gt;George&lt;/a&gt;.

@George - interesting use-case indeed. Thanks for sharing.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/changing-matlab-command-window-colors#comment-197570">George</a>.</p>
<p>@George &#8211; interesting use-case indeed. Thanks for sharing.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
