﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-杰-随笔分类-Matlab</title><link>http://www.cppblog.com/guijie/category/13862.html</link><description>杰哥好,哈哈!</description><language>zh-cn</language><lastBuildDate>Wed, 08 Jun 2022 22:40:13 GMT</lastBuildDate><pubDate>Wed, 08 Jun 2022 22:40:13 GMT</pubDate><ttl>60</ttl><item><title>How to read *.data in Matlab and Python</title><link>http://www.cppblog.com/guijie/archive/2018/10/13/216005.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 12 Oct 2018 20:33:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2018/10/13/216005.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/216005.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2018/10/13/216005.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/216005.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/216005.html</trackback:ping><description><![CDATA[<div>See P2 of "HW2_545_2018_"<br /><br />In Matlab:</div><div>z = dlmread('spambase.data',',');</div><div>In Python:</div><div>import numpy as np</div><div>z = np.genfromtxt('spambase.data', dtype=float, delimiter=',')</div><div></div><img src ="http://www.cppblog.com/guijie/aggbug/216005.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2018-10-13 04:33 <a href="http://www.cppblog.com/guijie/archive/2018/10/13/216005.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab legend字号改变</title><link>http://www.cppblog.com/guijie/archive/2017/12/19/215431.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Mon, 18 Dec 2017 20:50:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2017/12/19/215431.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/215431.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2017/12/19/215431.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/215431.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/215431.html</trackback:ping><description><![CDATA[<div>hleg1&nbsp;=&nbsp;legend('SBQ','DBQ','IBQ',4);<br />set(hleg1,'Interpreter','none');<br />set(hleg1,'FontSize',15);&nbsp;<br /><br />set(gca,'linewidth',2);<br />set(gca,'FontName','Times&nbsp;New&nbsp;Roman','FontSize',12);<br />set(gca,'xtick',[16&nbsp;32&nbsp;64&nbsp;128]);<br /><br />This is with Yuan Cao's help.</div><img src ="http://www.cppblog.com/guijie/aggbug/215431.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2017-12-19 04:50 <a href="http://www.cppblog.com/guijie/archive/2017/12/19/215431.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转载]matlab中text 函数在显示字符串时的使用方法</title><link>http://www.cppblog.com/guijie/archive/2017/12/17/215429.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sun, 17 Dec 2017 04:53:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2017/12/17/215429.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/215429.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2017/12/17/215429.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/215429.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/215429.html</trackback:ping><description><![CDATA[<div style="word-wrap: break-word; color: #494949; font-family: simsun; line-height: 21px; background-color: #e2ddc7; margin-bottom: 12px;"><span style="word-wrap: normal; word-break: normal; margin-right: 25px;"><strong style="word-wrap: break-word;">原文地址：</strong><a target="_blank" href="http://blog.sina.com.cn/s/blog_49d955150100i3c0.html" title="matlab中text&nbsp;函数在显示字符串时的使用方法" style="word-wrap: break-word; color: #6a6352; text-decoration-line: none; border: none;">matlab中text&nbsp;函数在显示字符串时的使用方法</a></span><span style="word-wrap: normal; word-break: normal;"><strong style="word-wrap: break-word;">作者：</strong><a href="http://blog.sina.com.cn/u/1238979861" title="gypsy" target="_blank" style="word-wrap: break-word; color: #6a6352; text-decoration-line: none; border: none;">gypsy</a></span></div><div style="word-wrap: break-word; color: #494949; font-family: simsun; line-height: 21px; background-color: #e2ddc7;"><p align="center" style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">matlab中text 函数在显示字符串时的使用方法</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">&nbsp;功能 在当前轴中创建text对象。函数text是创建text图形句柄的低级函数。可用该函数在图形中指定的位置上显示字符串。</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">用法 text(x,y,'string')在图形中指定的位置(x,y)上显示字符串string</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">text(x,y,z,'string') 在三维图形空间中的指定位置(x,y,z)上显示字符串string</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">text(x,y,z,&#8217;string&#8217;.'PropertyName',PropertyValue&#8230;) 对引号中的文字string定位于用坐标轴指定的位置，且对指定的属性进行设置。表7-6给出文字属性名、含义及属性值。</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">表7-6</p><table cellspacing="0" cellpadding="0" border="1" style="word-wrap: break-word; empty-cells: show; border-collapse: collapse; margin: 0px; padding: 0px;"><tbody style="word-wrap: break-word;"><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">属性名</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">属性说明</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">属性值</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">定义字符串</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Editing</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">能否对文字进行编辑</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：off</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Interpretation</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">TeX字符是否可用</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：tex、none</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：tex</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">String</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">字符串(包括TeX字符串)</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：可见字符串</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">放置字符串</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Extent</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">text对象的范围（位置与大小）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：[left, bottom, width, height]</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">HorizontalAlignment</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字水平方向的对齐方式</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：left(文本外框左边对齐，缺省对齐方式)、center(文本外框中间对齐)、right(文本外框右边对齐)</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：left</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Position</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字范围的位置</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：[x,y,z]直角坐标系</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：[]（空矩阵）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Rotation</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字对象的方位角度</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：标量（单位为度）</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：0</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Units</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字范围与位置的单位</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：pixels (屏幕上的像素点)、normalized (把屏幕看成一个长、宽为1的矩形)、inches(英寸)、centimeters(厘米)、points (图象点)、data</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：data</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">VerticalAlignment</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字垂直方向的对齐方式</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：top (文本外框顶上对齐)、cap(文本字符顶上对齐)、middle(文本外框中间对齐)、baseline(文本字符底线齐)、bottom(文本外框底线对齐)</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：middle</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">指定文字字体</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">FontAngle</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置斜体文字模式</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：normal(正常字体)、italic(斜体字)、oblique(斜角字)</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：normal</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">FontName</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字字体名称</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：用户系统支持的字体名或者字符串FixedWidth。</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值为 Helvetica</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">FontSize</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字字体大小</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：结合字体单位的数值</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值为：10 points</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">FontUnits</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置属性FontSize的单位</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：points (1点=1/72英寸)、normalized(把父对象坐标轴作为一单位长的一个整体；当改变坐标轴的尺寸时，系统会自动改变字体的大小)、inches (英寸)、Centimeters(厘米)、Pixels(像素)</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：points</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">FontWeight</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字字体的粗细</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：light(细字体)、normal(正常字体)、demi(黑体字)、Bold(黑体字)</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：normal</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">控制文字外观</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Clipping</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置坐标轴中矩形的剪辑模式</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">on：当文本超出坐标轴的矩形时，超出的部分不显示；</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">off：当文本超出坐标轴的矩形时，超出的部分显示。</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：off</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">EraseMode</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置显示与擦除文字的模式。这些模式对生成动画系列与改进文字的显示效果很有好处。</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：normal、none、 xor、 background</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：normal</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">SelectionHighlight</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置选中文字是否突出显示</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：on</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Visible</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字是否可见</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：on</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Color</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字颜色</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效的颜色值：ColorSpec</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">控制对文字对象的访问</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">HandleVisibility</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字对象句柄对其他函数是否可见</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、callback、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：on</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">HitTest</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字对象能否成为当前对象（见图形CurrentObject属性）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：on</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字对象的一般信息</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Children</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字对象的子对象（文字对象没有子对象）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：[]（即空矩阵）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Parent</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">文字对象的父对象（通常为axes对象）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：axes的句柄</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Seleted</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置文字是否显示出&#8220;选中&#8221;状态</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：off</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Tag</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置用户指定的标签</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：任何字符串</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：&#8217;&#8217;（即空字符串）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Type</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置图形对象的类型（只读类型）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：字符串&#8217;text&#8217;</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">UserData</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置用户指定数据</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：任何矩阵</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：[]（即空矩阵）</p></td></tr><tr style="word-wrap: break-word;"><td width="545" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">控制回调例行执行程序</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">BusyAction</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置如何处理对文字回调过程中断的句柄</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：cancel、queue</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：queue</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">ButtonDownFcn</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置当鼠标在文字上单击时，程序做出的反应（即执行回调程序）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：字符串</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：' '（空字符串）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">CreateFcn</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置当文字被创建时，程序做出的反应（即执行的回调程序）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：字符串</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：' '（空字符串）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">DeleteFcn</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置当文字被删除（通过关闭或删除操作）时，程序做出的反应（即执行的回调程序）</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：字符串</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：' '（空字符串）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">Interruptible</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置回调过程是否可中断</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：on、off</p><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">缺省值：on（能中断）</p></td></tr><tr style="word-wrap: break-word;"><td width="135" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">UIContextMenu</p></td><td width="170" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">设置与文字相关的菜单项</p></td><td width="240" style="word-wrap: break-word; margin: 0px; padding: 0px; font-size: 12px; font-family: Verdana, 宋体, sans-serif; line-height: 18px;"><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal; text-indent: 2em;">有效值：用户相关菜单句柄</p></td></tr></tbody></table><p style="word-wrap: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; border: 0px; list-style: none; word-break: normal;">&nbsp;</p>MATLAB资源网：<a href="http://www.ymlib.net/article/sort010/info-276.html" target="_blank" style="word-wrap: break-word; color: #6a6352; text-decoration-line: none; border: none;">http://www.ymlib.net/article/sort010/info-276.html<br /><div>http://blog.sciencenet.cn/blog-711035-566055.html</div></a></div><img src ="http://www.cppblog.com/guijie/aggbug/215429.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2017-12-17 12:53 <a href="http://www.cppblog.com/guijie/archive/2017/12/17/215429.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab ColorSpec (Color Specification)</title><link>http://www.cppblog.com/guijie/archive/2017/12/10/215417.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sat, 09 Dec 2017 18:27:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2017/12/10/215417.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/215417.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2017/12/10/215417.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/215417.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/215417.html</trackback:ping><description><![CDATA[https://www.mathworks.com/help/matlab/ref/colorspec.html<br /><br /><br /><table table-condensed"="" style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; background-color: #ffffff; width: 1219.2px; border-style: solid none none solid; border-top-color: #cccccc; border-left-color: #cccccc; border-right-width: initial; border-right-color: initial; border-bottom-width: initial; border-bottom-color: initial; font-size: 11.96px; max-width: 100%; line-height: 1.5; color: #404040; font-family: Arial, Helvetica, sans-serif; margin-bottom: 0px !important; transition: none !important;"><thead style="box-sizing: border-box; transition: none !important;"><tr style="box-sizing: border-box; transition: none !important;"><th style="box-sizing: border-box; padding: 6px 5px; text-align: left; border-top: 0px; border-left: none; border-image: initial; border-right: 1px solid #cccccc; border-bottom: 1px solid #cccccc; background: #eaeaea; color: #000000; vertical-align: middle; line-height: 1.42857; transition: none !important;"><p style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;">RGB Triplet</p></th><th style="box-sizing: border-box; padding: 6px 5px; text-align: left; border-top: 0px; border-left: none; border-image: initial; border-right: 1px solid #cccccc; border-bottom: 1px solid #cccccc; background: #eaeaea; color: #000000; vertical-align: middle; line-height: 1.42857; transition: none !important;"><p style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;">Short Name</p></th><th style="box-sizing: border-box; padding: 6px 5px; text-align: left; border-top: 0px; border-left: none; border-image: initial; border-right: 1px solid #cccccc; border-bottom: 1px solid #cccccc; background: #eaeaea; color: #000000; vertical-align: middle; line-height: 1.42857; transition: none !important;"><p style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;">Long Name</p></th></tr></thead><tbody style="box-sizing: border-box; transition: none !important;"><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235305" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[1 1 0]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235307" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">y</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235309" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">yellow</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235311" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[1 0 1]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235313" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">m</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235315" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">magenta</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235317" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[0 1 1]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235319" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">c</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235321" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">cyan</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235323" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[1 0 0]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235325" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">r</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235327" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">red</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235329" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[0 1 0]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235331" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">g</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235333" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">green</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235335" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[0 0 1]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235337" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">b</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235339" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">blue</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235341" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[1 1 1]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235343" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">w</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235345" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">white</code></p></td></tr><tr style="box-sizing: border-box; transition: none !important;"><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235347" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">[0 0 0]</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235350" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">k</code></p></td><td style="box-sizing: border-box; padding: 3px 5px; border-top: none; border-left: none; border-right-style: solid; border-right-color: #cccccc; border-bottom-style: solid; border-bottom-color: #cccccc; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; vertical-align: top; line-height: 1.42857; transition: none !important;"><p id="f19-235352" style="box-sizing: border-box; margin: 0px; padding: 0px; transition: none !important;"><code style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-radius: 0px; transition: none !important;">black</code></p></td></tr></tbody></table><img src ="http://www.cppblog.com/guijie/aggbug/215417.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2017-12-10 02:27 <a href="http://www.cppblog.com/guijie/archive/2017/12/10/215417.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Professor Deng Cai's code, very good code</title><link>http://www.cppblog.com/guijie/archive/2017/11/26/215370.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sun, 26 Nov 2017 05:10:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2017/11/26/215370.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/215370.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2017/11/26/215370.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/215370.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/215370.html</trackback:ping><description><![CDATA[<span style="color: #212121; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px; background-color: #ffffff;">20171125 rutgers&nbsp;email: Please check&nbsp;</span><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdengcai78%2FMatlabFunc&amp;data=02%7C01%7Cjie.gui%40rutgers.edu%7Ccc91a8dece38489b84c708d534888d5f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C636472683460873626&amp;sdata=O8pd0ZRw5nRMt7QFQiVCYCDLcRwKhYDjmlzpZ3LPmy0%3D&amp;reserved=0" target="_blank" rel="noopener noreferrer" style="font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px; background-color: #ffffff;">https://github.com/dengcai78/MatlabFunc</a><span style="color: #212121; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px; background-color: #ffffff;">&nbsp; for the most up-to-date codes.</span><img src ="http://www.cppblog.com/guijie/aggbug/215370.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2017-11-26 13:10 <a href="http://www.cppblog.com/guijie/archive/2017/11/26/215370.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]MATLAB如何实现十进制数与二进制数的转换</title><link>http://www.cppblog.com/guijie/archive/2017/11/08/215336.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Wed, 08 Nov 2017 04:49:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2017/11/08/215336.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/215336.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2017/11/08/215336.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/215336.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/215336.html</trackback:ping><description><![CDATA[<span style="color: #333333; font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; text-align: justify; background-color: #ffffff;">在MATLAB 中，实现十进制与二进制转化的函数有dec2bin()，bin2dec()。<br /><br /></span><div><strong>Reference</strong><br />http://jingyan.baidu.com/article/59703552c5699a8fc00740d2.html</div><img src ="http://www.cppblog.com/guijie/aggbug/215336.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2017-11-08 12:49 <a href="http://www.cppblog.com/guijie/archive/2017/11/08/215336.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab dir</title><link>http://www.cppblog.com/guijie/archive/2017/09/26/215265.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Mon, 25 Sep 2017 16:28:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2017/09/26/215265.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/215265.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2017/09/26/215265.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/215265.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/215265.html</trackback:ping><description><![CDATA[<div>Matlab帮助: list folder contents.<br />针对根目录，列出所有子文件夹，包括隐藏文件。注意针对非根目录，还有多出两个文件夹"."和".."，分别对应本目录和上一层目录。故TrainDataLoading.m的第八行和第九行如下：<br /><div>&nbsp; &nbsp;templist&nbsp; = dir(session_dir_name);</div><div>&nbsp; &nbsp;folderlist = templist(3:end); % delete the first two null directory</div>见本机dir_.m和TrainDataLoading.m。<br />用windows菜单，开始，所有程序，附件，命令提示符，输入dir就会列出所有目录，会看到有两个文件夹"."和".."。cd C:\，定位到根目录，再dir，没有两个文件夹"."和".."。<br />This is with Nannan and Zhongze's help.</div><img src ="http://www.cppblog.com/guijie/aggbug/215265.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2017-09-26 00:28 <a href="http://www.cppblog.com/guijie/archive/2017/09/26/215265.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz] Matlab中使用.p文件的方法</title><link>http://www.cppblog.com/guijie/archive/2016/07/29/214068.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 29 Jul 2016 07:13:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2016/07/29/214068.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/214068.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2016/07/29/214068.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/214068.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/214068.html</trackback:ping><description><![CDATA[<div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">首先，P文件为了保护知识产权设计的一种加密文件，是不能查看的。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">运行比较简单，和调用m文件方法一样。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">下面是一些解释。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文件是对应M文件的一种预解析版本（preparsed version）。因为当你第一次执行M文件时，Matlab需要将其解析（parse）一次（第一次执行后的已解析内容会放入内存作第二次执行时使用，即第二次执行时无需再解析），这无形中增加了执行时间。所以我们就预先作解释，那么以后再使用该M文件时，便会直接执行对应的已解析版本，即P文件。但又因为Matlab的解析速度非常快，一般不用自己作预解析。只有当一些程序要调用到非常多的M文件时，如GUI应用程序时，才会作预解析，以增加以后的调用速度。&nbsp;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文件可以用来作保密代码之用，如果你给别人一个M文件，别人可以打开来看到你所有的代码和算法。<span style="color: red;">如果你的代码不想被别人看到，那可以给他P文件。</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><strong>如何使用.p文件</strong></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">1.首先，将当前工作目录切换到.p文件所在的目录，然后就可以在左侧的工作空间窗口看见该目录所包含的所有文件了，当然包括.p文件啦~</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">2.由于.p文件是.m文件的预解析版本（不能查看、编辑），显然.p文件同.m文件一样都是一个函数体，只不过此时该函数是一个黑盒子罢了。举例如test.p文件便意味着存在一个已经编好的函数test（如何实现我们不知道），为调用这个函数test，我们需要知道它的参数形式 此时在命令窗口下键入help test，即可查看到test函数的参数 然后我们就可以调用啦</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><strong style="color: red;">如何自己制作.p文件</strong></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">在Matlab中，我们经常把语句或函数写在一个M文件里，便于模块化和代码重用，比如，写一个test.m的文件（即自定义一个test函数）：</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% test.m</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a = 1;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">b = 2;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">这个M语句文件，或：</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% test2.m</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">function a = test2(b)</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a = b * 2;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">这个M函数。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">我们在Command Window里输入：</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">&gt;&gt; test</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">即是等于输入了</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">&gt;&gt; a = 1;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">&gt;&gt; b = 2;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">而输入：</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">&gt;&gt; a = test2(2)</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a =</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">&nbsp; &nbsp; &nbsp;4</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">便是执行了一个函数。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">以上的内容我想大部份人都知道是怎么一回事了，以下说一说P代码文件。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">如果在Command Window里输入：</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">&gt;&gt; pcode test</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">便会在相应test.m的文件夹里产生了test.p。如果这时在Command Window里输入：</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">&gt;&gt; test</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">其实是运行了test.p，而不是test.m。</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文件是对应M文件的一种预解析版本（preparsed version）。因为当你第一次执行M文件时，Matlab需要将其解析（parse）一次（第一次执行后的已解析内容会放入内存作第二次执行时使用，即第二次执行时无需再解析），这无形中增加了执行时间。所以我们就预先作解释，那么以后再使用该M文件时，便会直接执行对应的已解析版本，即P文件。但又因为Matlab的解析速度非常快，一般不用自己作预解析。只有当一些程序要调用到非常多的M文件时，如GUI应用程序时，才会作预解析，以增加以后的调用速度。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">如Matlab的当前目录（Current Directory）有test.m文件，作预解析后，又有test.p文件。因为P文件的调用优先级比M文件要高，所以当你调用test时，会作优先选择而调用了test.p。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">可以修改test.m的代码为：</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% test.m</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a = 3;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">b = 4;</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">再在Command Window里调用test：</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">&gt;&gt; test</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">Warning: P-file C:\Program Files\MATLAB71\work\test.p is older than M-file C:\Program Files\MATLAB71\work\test.m.</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">C:\Program Files\MATLAB71\work\test.p may be obsolete and may need to be regenerated.</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">Type "help pcode" for information about generating P-files from M-files.</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">会出现一个Warning，警告你所调用的P文件比同名的M文件要旧，即表示M文件已被修改了。尽管如此，调用的还是旧的P文件，即得出a = 1和 b = 2。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文件可以用来作保密代码之用，如果你给别人一个M文件，别人可以打开来看到你所有的代码和算法。如果你的代码不想被别人看到，那可以给他P文件。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">pcode函数也可以应用在M函数文件。</div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: &quot;Hiragino Sans GB W3&quot;, &quot;Hiragino Sans GB&quot;, Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><div style="line-height: 22px;">参考：<br /><div>http://zmryyj.blog.163.com/blog/static/98450751201132081451490/</div></div><div style="line-height: 22px;">http://frenselx.spaces.live.com/blog/cns!3D7342371BEE8602!290.entry<br />阅读记录: read twice, understand completely</div></div><img src ="http://www.cppblog.com/guijie/aggbug/214068.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2016-07-29 15:13 <a href="http://www.cppblog.com/guijie/archive/2016/07/29/214068.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The matlab code of Locality sensitive hashing (LSH)</title><link>http://www.cppblog.com/guijie/archive/2015/11/27/212354.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 27 Nov 2015 14:24:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/11/27/212354.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/212354.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/11/27/212354.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/212354.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/212354.html</trackback:ping><description><![CDATA[%see the matlab code test.m of CCA-ITQ. It is very simple. Only one sentence using random projection<br /><div>XX = XX * randn(size(XX,2),bit);</div><div>Y = zeros(size(XX));</div><div>Y(XX&gt;=0)=1;</div><div>Y = compactbit(Y);</div><img src ="http://www.cppblog.com/guijie/aggbug/212354.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-11-27 22:24 <a href="http://www.cppblog.com/guijie/archive/2015/11/27/212354.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab函数meshgrid</title><link>http://www.cppblog.com/guijie/archive/2015/09/11/211803.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 11 Sep 2015 04:42:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/09/11/211803.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/211803.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/09/11/211803.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/211803.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/211803.html</trackback:ping><description><![CDATA[<span style="color: red">问题：</span> 
<p>使用matlab怎么能够产生这样的一组数组呢？<br />x = 1,2,3,4<br />y = 5,6</p>
<p>产生一组点：</p>
<p>(1,5) (1,6)<br />(2,5) (2,6)<br />(3,5) (3,6)<br />(4,5) (4,6)<br /><br /><span style="color: red"><br />答案：</span><br /><!--StartFragment -->
</p>
<div>x&nbsp;=&nbsp;[1,2,3,4];<br />y&nbsp;=&nbsp;[5,6];<br />[X,Y]&nbsp;=&nbsp;meshgrid(x,y);<br />[X(:),&nbsp;Y(:)] </div>
<p><br /></p><img src ="http://www.cppblog.com/guijie/aggbug/211803.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-09-11 12:42 <a href="http://www.cppblog.com/guijie/archive/2015/09/11/211803.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab函数fminunc:求无约束优化的最优解</title><link>http://www.cppblog.com/guijie/archive/2015/08/13/211551.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Thu, 13 Aug 2015 04:59:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/08/13/211551.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/211551.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/08/13/211551.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/211551.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/211551.html</trackback:ping><description><![CDATA[例：K-means Hashing提供的代码optimize_one_iter函数内部用到fminunc，代价函数是eval_one_center函数，看eval_one_center函数的注释是this function computes the cost of Eqn. (8) given a center c_j<img src ="http://www.cppblog.com/guijie/aggbug/211551.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-08-13 12:59 <a href="http://www.cppblog.com/guijie/archive/2015/08/13/211551.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab加速: bsxfun</title><link>http://www.cppblog.com/guijie/archive/2015/08/05/211481.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Wed, 05 Aug 2015 03:18:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/08/05/211481.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/211481.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/08/05/211481.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/211481.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/211481.html</trackback:ping><description><![CDATA[%<span style="color: red">将训练数据和测试数据都去中心化</span><br />X = traindata;<br />label = traingnd;<br />m = mean(X);<br />X_zm = bsxfun(@minus, X, m);<br />traindata_zm = bsxfun(@minus, traindata, m);<br />testdata_zm = bsxfun(@minus, testdata, m);<br /><br />matlab函数 bsxfun浅谈（转载）<br /><a href="http://blog.sina.com.cn/s/blog_9e67285801010ttn.html">http://blog.sina.com.cn/s/blog_9e67285801010ttn.html</a> 
<p style="text-align: left; line-height: 15.75pt; margin: 0cm 0cm 3.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">网上关于</span><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的东西不多，今天需要看到一个，由于原博文插入的图片显示不出来，于是笔者大发善心进行了</span><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">contrl+V </span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">以及</span><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">alt+ctrl+A</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的操作，供大家交流学习。</span><span style="font-family: 'simsun','serif'; color: #464646"></span></p>
<p style="text-align: left; line-height: 15.75pt; margin: 0cm 0cm 3.75pt;background: white" align="left">&nbsp;</p>
<p style="text-align: left; line-height: 15.75pt; margin: 0cm 0cm 3.75pt;background: white" align="left"><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">是一个</span><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">matlab</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">自版本</span><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">R2007a</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">来就提供的一个函数，作用是</span><span style="font-family: 'simsun','serif'; color: #464646; font-size: 13.5pt">&#8221;applies an element-by-element binary operation to arrays a and b, with singleton expansion enabled.&#8221;</span></p>
<p style="text-align: left; line-height: 15.75pt; margin: 0cm 0cm 3.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">举个例子。假设我们有一列向量和一行向量。</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">a = randn(3,1), b = randn(1,3) a = -0.2453 -0.2766 -0.1913 b = 0.6062 0.5655 0.9057</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">我们可以很简单的使用</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">matlab</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的外乘</span><span style="font-family: 'Courier New'; color: #7ca653; font-size: 13.5pt">c=a*b</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">来得到，如图</span><a href="http://photo.blog.sina.com.cn/showpic.html#blogid=9e67285801010ttn&amp;url=http://s4.sinaimg.cn/orignal/9e672858gbf589be236e3" target="_blank"><span style="font-family: 'Courier New'; color: #9c2805; font-size: 13.5pt; text-decoration: none; text-underline: none"> bsxfun浅谈（转载）" o:button="t" target='"_blank"' o:spid="_x0000_i1025"&gt;bsxfun浅谈（转载）" src="file:///C:\Users\jie\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg"&gt;</a></span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt"><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">但如果我们想用</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">&#8221;</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">外加</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">&#8221;</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">呢？也就是说把上式求解过程中的乘号换做加号？</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">这时我们可以用</span><span style="font-family: 'Courier New'; color: #7ca653; font-size: 13.5pt">c=bsxfun(@plus,a,b)</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">来实现。</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的执行是这样的，如果</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">a</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">和</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">b</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的大小相同，那么</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">c=a+b. </span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">但如果有某维不同，且</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">a</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">或</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">b</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">必须有一个在这一维的维数为</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">1, </span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">那么</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">就将少的这个虚拟的复制一些来使与多的维数一样。在我们这里，</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">b</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的第一维只有</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">1</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">（只一行），所以</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">将</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">b</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">复制</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">3</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">次形成一个</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">3&#215;3</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的矩阵，同样也将</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">a</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">复制成</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">3&#215;3</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的矩阵。这个等价于</span><span style="font-family: 'Courier New'; color: #7ca653; font-size: 13.5pt">c=repmat(a,1,3)+repmat(b,3,1)</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">。这里</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">repmat(a,1,3) ans = -0.2453 -0.2453 -0.2453 -0.2766 -0.2766 -0.2766 -0.1913 -0.1913 -0.1913</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt"><br />repmat</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">是显式的复制，当然带来内存的消耗。而</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">是虚拟的复制，实际上通过</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">for</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">来实现，等效于</span><span style="font-family: 'Courier New'; color: #7ca653; font-size: 13.5pt">for(i=1:3),for(j=1:3),c(i,j)=a(i)+b(j);end,end</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">。但</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">bsxfun</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">不会有使用</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">matlab</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">的</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">for</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">所带来额外时间。实际验证下这三种方式</span><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt"><br /><br /><br /></span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">&gt;&gt; c = bsxfun(@plus,a,b) c = 0.3609 0.3202 0.6604 0.3296 0.2889 0.6291 0.4149 0.3742 0.7144 &gt;&gt; c = repmat(a,1,3)+repmat(b,3,1) c = 0.3609 0.3202 0.6604 0.3296 0.2889 0.6291 0.4149 0.3742 0.7144 &gt;&gt; for(i=1:3),for(j=1:3),c(i,j)=a(i)+b(j);end,end,c c = 0.3609 0.3202 0.6604 0.3296 0.2889 0.6291 0.4149 0.3742 0.7144</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646; font-size: 13.5pt"><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">从计算时间上来说前两种实现差不多，远高于for的实现。但如果数据很大，第二种实现可能会有内存上的问题。</span><span style="font-family: 宋体; color: red; font-size: 13.5pt">所以bsxfun最好。<br /><br /><br />下面看一个更为实际的情况。假设我们有数据A和B, 每行是一个样本，每列是一个特征。我们要计算高斯核，既：<br /><br /><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt"><br /><br /><br />这里@plus是加法的函数数柄，相应的有减法@minus, 乘法@times, 左右除等，具体可见 doc bsxfun.<br /><br /><br />&nbsp;</span><span style="font-family: 宋体; color: #333333; font-size: 12pt">k(||x-xc||)=exp{- ||x-xc||^2/(2*&#963;)^2) } </span><span style="font-family: 宋体; color: #333333; font-size: 12pt">其中xc为核函数中心,&#963;为函数的宽度参数&nbsp;, 控制了函数的径向作用范围。</span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt"><br /><br /><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">当然可以用双重for实现（如果第一直觉是用三重for的话&#8230;）。<br /><br /><br /></span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">K1 = zeros(size(A,1),size(B,1)); for i = 1 : size(A,1) for j = 1 : size(B,1) K1(i,j) = exp(-sum((A(i,:)-B(j,:)).^2)/beta); end end</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646"><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">使用2,000&#215;1,000大小的A和B, 运行时间为88秒。</span><span style="font-family: 宋体; color: #464646"><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">考虑下面向量化后的版本：</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">sA = (sum(A.^2, 2)); sB = (sum(B.^2, 2)); K2 = exp(bsxfun(@minus,bsxfun(@minus,2*A*B', sA), sB')/beta);</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 宋体; color: #464646"><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">使用同样数据，运行时间仅0.85秒，加速超过100倍。</span><span style="font-family: 宋体; color: #464646"><br /></span><span style="font-family: 宋体; color: #464646; font-size: 13.5pt">如要判断两者结果是不是一样，可以如下</span></p>
<p style="text-align: left; line-height: 15.75pt;background: white" align="left"><span style="font-family: 'Courier New'; color: #464646; font-size: 13.5pt">assert(all(all(abs(K1-K2)&lt;1e-12)))</span></p>
<p>&nbsp;</p><br /><img src ="http://www.cppblog.com/guijie/aggbug/211481.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-08-05 11:18 <a href="http://www.cppblog.com/guijie/archive/2015/08/05/211481.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab函数cat</title><link>http://www.cppblog.com/guijie/archive/2015/07/23/211346.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Thu, 23 Jul 2015 00:36:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/07/23/211346.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/211346.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/07/23/211346.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/211346.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/211346.html</trackback:ping><description><![CDATA[问题：两个图像矩阵A=M*N*K1，B=M*N*K2，第三维K1，K2表示数量，matlab怎么快速实现他们在第三维数量上的叠加。<br />答：cat(3,A,B)<img src ="http://www.cppblog.com/guijie/aggbug/211346.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-07-23 08:36 <a href="http://www.cppblog.com/guijie/archive/2015/07/23/211346.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to solve AX + XB = C for X using matlab?</title><link>http://www.cppblog.com/guijie/archive/2015/07/06/211161.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Mon, 06 Jul 2015 07:28:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/07/06/211161.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/211161.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/07/06/211161.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/211161.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/211161.html</trackback:ping><description><![CDATA[<font face="Courier New">X = sylvester(A,B,C)</font> <br /><a href="http://cn.mathworks.com/help/matlab/ref/sylvester.html">http://cn.mathworks.com/help/matlab/ref/sylvester.html</a><img src ="http://www.cppblog.com/guijie/aggbug/211161.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-07-06 15:28 <a href="http://www.cppblog.com/guijie/archive/2015/07/06/211161.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>f-measure matlab</title><link>http://www.cppblog.com/guijie/archive/2015/06/30/211106.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Tue, 30 Jun 2015 13:07:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/06/30/211106.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/211106.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/06/30/211106.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/211106.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/211106.html</trackback:ping><description><![CDATA[supervised discrete hashing的evaluate_macro代码理解：在主程序中调用时，evaluate_macro的前一个输入参数是cateTrainTest，是训练样本数*测试样本数的矩阵。evaluate_macro函数体中，对每个测试样本，retrieved_relevant_num代表TP；relevant_num代表TP+FN；retrieved_num代表TP+FP。所有样本分别的平均precision即是最终的输出precision，所有样本分别的平均recall即是最终的输出recall。<br />cat_apcal函数是计算MAP的，代码意义很好理解，比如按距离排序，前七个只有1、3、5和7是和query相同的类，则MAP=(1+2/3+3/5+4/7)/4 (This is with discussing with Shu Zhang). 但Deep hashing for compact (CVPR 2015) mean average<br />precision (mAP): which computes the area under the precision-recall curve.<br /><span style="color: red">matlab曲线下如何求面积?</span><br />如果知道函数表达式的话，调用quad函数就可以了。如果不知道函数表达式只知道这一系列离散点，x和y，则trapz(x,y)即可<br />例1：本机Hashing\code\ITQ\delete\test_cifar_PCA_ITQ_V01.m，对画出的precison和recall曲线，计算曲线下的面积，用trapz(recall,precision)即可<br />Shu Zhang说不知以上两种是否等价，如果按照Deep hashing for compact (CVPR 2015)算面积，则直接就能看出不同的方法谁的MAP大，因为谁的曲线在上方就谁大<br /><br /><div><strong>身份证照片和真人的比对有两个指标</strong></div><div>误识率：他明明不是张三，但你错误地把他判断成了张三。误识率1%，意味着有100个人来冒充其他人，有1个人会冒充成功。应该就是FAR</div><div>识别率：张三有10%左右的概率被系统说你不是张三，识别率90%。应该就是1-FRR</div><div>二代证比真人：识别率90% (误识率1%)</div><div>即使在1%的认假率的情况下，识别率目前可能大概做到90%左右。当然这个前提条件是说，我们用的是二代证卡内的那张低质量，压缩得非常狠，照片的分辨率不够高的那张小照片。如果我们用的是一张清晰的，近期的证件照，那么这个结论可以做到大概，误识率可以做到万分之一的情况下，识别率可以做到90%以上的正确率。</div><div><strong>Reference</strong>：</div><div>造就Talk | 山世光：天眼系统终将开启，你准备好了吗？http://mp.weixin.qq.com/s?__biz=MzAwNTcyNDU5MQ==&amp;mid=509662068&amp;idx=1&amp;sn=f14840fb7927497ad0d49e1d18eb6b5a&amp;scene=1&amp;srcid=0529xR8z0qC240GLkQZuUAG9&amp;from=groupmessage&amp;isappinstalled=0#wechat_redirect 已看两次</div><a href="http://www.mathworks.com/matlabcentral/fileexchange/37758-performance-measures-for-classification/content/Evaluate.m"><br />http://www.mathworks.com/matlabcentral/fileexchange/37758-performance-measures-for-classification/content/Evaluate.m</a><br /><pre style="text-align: left; padding-bottom: 0px; line-height: 16px; widows: 1; text-transform: none; background-color: #ffffff; font-variant: normal; font-style: normal; text-indent: 0px; margin: 0px; padding-left: 0px; width: 600px !important; letter-spacing: normal; padding-right: 0px; display: block; word-wrap: break-word; white-space: pre-wrap; color: #626b77; font-size: 12px; overflow: hidden !important; font-weight: normal; word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px" class="matlab-code">function EVAL = Evaluate(ACTUAL,PREDICTED)
% This fucntion evaluates the performance of a classification model by 
% calculating the common performance measures: Accuracy, Sensitivity, 
% Specificity, Precision, Recall, F-Measure, G-mean.
% Input: ACTUAL = Column matrix with actual class labels of the training
%                 examples
%        PREDICTED = Column matrix with predicted class labels by the
%                    classification model
% Output: EVAL = Row matrix with all the performance measures


idx = (ACTUAL()==1);

p = length(ACTUAL(idx));
n = length(ACTUAL(~idx));
N = p+n;

tp = sum(ACTUAL(idx)==PREDICTED(idx));
tn = sum(ACTUAL(~idx)==PREDICTED(~idx));
fp = n-tn;
fn = p-tp;

tp_rate = tp/p;
tn_rate = tn/n;

accuracy = (tp+tn)/N;
sensitivity = tp_rate;
specificity = tn_rate;
precision = tp/(tp+fp);
recall = sensitivity;
f_measure = 2*((precision*recall)/(precision + recall));
gmean = sqrt(tp_rate*tn_rate);

EVAL = [accuracy sensitivity specificity precision recall f_measure gmean];</pre><img src ="http://www.cppblog.com/guijie/aggbug/211106.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-06-30 21:07 <a href="http://www.cppblog.com/guijie/archive/2015/06/30/211106.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The matlab code of canonical correlation analysis (CCA)</title><link>http://www.cppblog.com/guijie/archive/2015/06/02/210807.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Tue, 02 Jun 2015 14:10:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/06/02/210807.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/210807.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/06/02/210807.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/210807.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/210807.html</trackback:ping><description><![CDATA[<p><span style="color: red;">%Reference: the matlab code of "CVPR 2011 Iterative Quantization". I have checked the correctness of the corresponding derivation and matlab code. No need to check again. Just use it</span><br /><br />function [Wx, r] = cca(X,Y,reg)</p>
<p>%<br />% X is input data for the 1st view (image), n*d, n images, d dim<br />% Y is input data for the 2nd view (Tag), n*D, D dim<br />% reg is regularization parameter, usually set by validation<br />% in our work, reg = 0.0001 which works well<br />%<br />% Wx is the embedding function for image<br />% r is the eigenvalue<br />%<br />%<br />% to run the code, you need visual data X and tag data Y<br />% <br />% bit = 32, 64, 128 ...<br /><span style="color: red">% [eigenvector,r] = cca(X, Y, 0.0001); % this computes CCA projections</span><br /><span style="color: red">% eigenvector = eigenvector(:,1:bit)*diag(r(1:bit)); % this performs a scaling using eigenvalues</span><br /><span style="color: red">% E = X*eigenvector; % final projection to obtain embedding E</span><br />%</p>
<p><br />z = [X, Y];<br />C = cov(z);<br />sx = size(X,2);<br />sy = size(Y,2);<br />Cxx = C(1:sx, 1:sx) + reg*eye(sx);<br />Cxy = C(1:sx, sx+1:sx+sy);<br />Cyx = Cxy';<br />Cyy = C(sx+1:sx+sy,sx+1:sx+sy) + reg*eye(sy);</p>
<p><br />Rx = chol(Cxx);<br />invRx = inv(Rx);<br />Z = invRx'*Cxy*(Cyy\Cyx)*invRx;<br />Z = 0.5*(Z' + Z);&nbsp;</p>
<p><br />[Wx,r] = eig(Z);&nbsp;&nbsp; % basis in h (X)<br />r = sqrt(real(r)); % as the original r we get is lamda^2<br />Wx = invRx * Wx;&nbsp;&nbsp; % actual Wx values<br />r = diag(r);</p>
<p>[r index] = sort(r,'descend');<br />Wx = Wx(:,index);</p>
<p>&nbsp;<br /><span style="color: red;">Other references:</span><br /></p><div>Information Fusion 2017 Multi-view learning overview的公式8和9<br />Section 2.1 of "NCA 2013 A survey of multi-view machine learning"</div>
<p>&nbsp;<br /><br /><br /></p><img src ="http://www.cppblog.com/guijie/aggbug/210807.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-06-02 22:10 <a href="http://www.cppblog.com/guijie/archive/2015/06/02/210807.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]matlab图像滤波</title><link>http://www.cppblog.com/guijie/archive/2015/05/11/210619.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Mon, 11 May 2015 12:33:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2015/05/11/210619.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/210619.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2015/05/11/210619.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/210619.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/210619.html</trackback:ping><description><![CDATA[clc;<br />clear;<br />I=imread('a.jpg');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %读取图像<br />K1=medfilt2(I,[10 10]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %中值滤波<br />h1=ones(5,5)/25;<br />K2=imfilter(K1,h1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %均值滤波<br />figure, imshow(K2), title('滤波后的图像')<img src ="http://www.cppblog.com/guijie/aggbug/210619.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2015-05-11 20:33 <a href="http://www.cppblog.com/guijie/archive/2015/05/11/210619.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The matlab code to normalize each feature of training data and test data to unit mean and zero variance</title><link>http://www.cppblog.com/guijie/archive/2014/12/05/209030.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 05 Dec 2014 04:32:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2014/12/05/209030.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/209030.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2014/12/05/209030.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/209030.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/209030.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br />&nbsp;&nbsp;&nbsp; fea_Train = fea(:,trainIdx);<br />&nbsp;&nbsp;&nbsp; gnd_Train = gnd(trainIdx);<br />&nbsp;&nbsp;&nbsp; fea_Test = fea(:,testIdx);<br />&nbsp;&nbsp;&nbsp; gnd_Test = gnd(testIdx);<br />&nbsp;&nbsp;&nbsp; train_size = length(gnd_Train);<br />&nbsp;&nbsp;&nbsp; test_size&nbsp; = length(gnd_Test);<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; %%%%%%%%%%%%%%%%%%%%%%%Normalization begins%%%%%%%%%%%%%%%%%%%%%%%<br />&nbsp;&nbsp;&nbsp; train_data_std = std(fea_Train');<br />&nbsp;&nbsp;&nbsp; train_data_mean = mean(fea_Train');<br />&nbsp;&nbsp;&nbsp; train_data_std_matrix = ones(train_size,dim)*diag(train_data_std);<br />&nbsp;&nbsp;&nbsp; train_data_std_matrix(train_data_std_matrix==0)=1;<br />&nbsp;&nbsp;&nbsp; train_data_mean_matrix = ones(train_size,dim)*diag(train_data_mean);<br />&nbsp;&nbsp;&nbsp; train_scale_data = (fea_Train' - train_data_mean_matrix)./train_data_std_matrix;<br />&nbsp;&nbsp;&nbsp; clear train_data_mean_matrix train_data_std_matrix;<br />&nbsp;&nbsp;&nbsp; fea_Train = train_scale_data';<br />&nbsp;&nbsp;&nbsp; clear train_scale_data;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; test_data_std_matrix = ones(test_size,dim)*diag(train_data_std);<br />&nbsp;&nbsp;&nbsp; test_data_mean_matrix = ones(test_size,dim)*diag(train_data_mean);<br />&nbsp;&nbsp;&nbsp; clear train_data_mean train_data_std;<br />&nbsp;&nbsp;&nbsp; test_data = (fea_Test' - test_data_mean_matrix)./test_data_std_matrix;<br />&nbsp;&nbsp;&nbsp; clear test_data_std_matrix test_data_mean_matrix;<br />&nbsp;&nbsp;&nbsp; fea_Test = test_data';<br />&nbsp;&nbsp;&nbsp; clear test_data;<br />&nbsp;&nbsp;&nbsp; %%%%%%%%%%%%%%%%%%%%%%%Normalization ends%%%%%%%%%%%%%%%%%%%%%%%  <img src ="http://www.cppblog.com/guijie/aggbug/209030.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2014-12-05 12:32 <a href="http://www.cppblog.com/guijie/archive/2014/12/05/209030.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>怎么安装*.jar文件？</title><link>http://www.cppblog.com/guijie/archive/2014/07/14/207643.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Mon, 14 Jul 2014 07:47:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2014/07/14/207643.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/207643.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2014/07/14/207643.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/207643.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/207643.html</trackback:ping><description><![CDATA[<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">http://featureselection.asu.edu/software.php</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">Information Gain</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，运行会提示，错误：</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">Undefined variable "weka" or class "weka.attributeSelection.InfoGainAttributeEval".<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个软件包是</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">*.jar</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件，原以为解压就能找到安装文件，但没有。</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">Weiqiang</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">讲要安装</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">java</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件。</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">Feature Selection Package</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件安装过程如下</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><o:p></o:p></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; color: red; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第一步</span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：安装</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">java(</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用我电脑中的</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">&#8220;JAVA </font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">虚拟机</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">&#8221;)</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，并配置环境变量：计算机</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-&gt;</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-&gt;</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">高级系统设置</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-&gt;环境变量<span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-&gt;</font></span>lenovo</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的用户变量</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-&gt;Path(如果没有PATH，新建一个变量PATH即可)-&gt;</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编辑</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-&gt;(</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">加入</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">&#8221;; C:\Program Files (x86)\Java\jre1.6.0_02\bin&#8221;到&#8220;变量值&#8221;,</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注意此处路径名可能不同</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">)</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><o:p></o:p></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><o:p><font face="Times New Roman">&nbsp;</font></o:p></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; color: red; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第二步</span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：安装</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">FeatureSelection-Installer.jar</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">到</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">E: \Feature Selection Package</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span><span style="mso-bidi-font-size: 10.5pt"><font face="Times New Roman"> </font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行<span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">cmd-&gt;</font></span>E:(定位到E盘);</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">cmd-&gt;cd E:\Kingsoft\other\matlab 2007a\work\Feature selection\</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">说明</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">(</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目的，定位到</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">FeatureSelection-Installer.jar</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所在目录</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">) -&gt;java -jar FeatureSelection-Installer.jar<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在安装过程中会有提示：</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><o:p></o:p></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><font face="Times New Roman"><span style="color: black; mso-bidi-font-size: 10.5pt; mso-themecolor: text1" lang="EN-US">what</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"> to do once you've installed Feature Selection Package:<o:p></o:p></span></font></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">1.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Open MATLAB<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">2.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Use MATLAB's 'cd' function to navigate to the folder you<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>installed Feature Selection Package into.<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">3.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Run the load_fspackage function with the command: 'load_fspackage'<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">4.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Select all of the commands you have run in this session, right click,<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>and select 'Create Shortcut'. This will give you a shortcut which<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>you can use to open Feature Selection Package at your choosing.<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只要到这里的</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">2</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">3</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">4</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不要管，</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">Weiqiang</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也不知此处</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">4</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">步代表啥含义，没管这一步。</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><o:p></o:p></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><o:p><font face="Times New Roman">&nbsp;</font></o:p></span></p>
<p style="text-align: left; margin: 0cm 0cm 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal" align="left"><span style="font-family: 宋体; color: red; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第三步</span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：将</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">load_fspackage.m</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的最开始一句</span><span style="color: black; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt" lang="EN-US"><font face="Times New Roman">&#8221;curPath = pwd;&#8221;(pwd</font></span><span style="font-family: 宋体; color: black; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt">的含义查</span><span style="color: black; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt" lang="EN-US"><font face="Times New Roman">matlab</font></span><span style="font-family: 宋体; color: black; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt">帮助即可，就是当前目录</span><span style="color: black; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt" lang="EN-US"><font face="Times New Roman">)</font></span><span style="font-family: 宋体; color: black; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt">中将</span><span style="color: black; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt" lang="EN-US"><font face="Times New Roman">pwd</font></span><span style="font-family: 宋体; color: black; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt">换成</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">load_fspackage.m</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所在的目录</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">'E:\Feature Selection Package\fspackage'</font></span><span style="font-family: 宋体; color: black; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt">即可。</span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt">在要使用该工具包的</span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序的最开始加上加上</span><font face="Times New Roman"><span style="color: red; mso-bidi-font-size: 10.5pt" lang="EN-US">run</span><span style="color: black; mso-bidi-font-size: 10.5pt; mso-themecolor: text1" lang="EN-US">('E:\Feature Selection Package\fspackage\load_fspackage.m')</span></font><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，这样就不会出现如下错了：</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">Undefined variable "weka" or class "weka.attributeSelection.InfoGainAttributeEval".<o:p></o:p></font></span></p>
<p style="text-align: left; margin: 0cm 0cm 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal" align="left"><span style="color: black; mso-bidi-font-size: 10.5pt; mso-themecolor: text1" lang="EN-US"><o:p><font face="Times New Roman">&nbsp;</font></o:p></span></p>
<p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">已经按照上述步骤，在我台式机成功安装</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">FeatureSelection-Installer.jar</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">(</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">台式机原来没安装</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">java</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">软件</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">)</font></span><span style="font-family: 宋体; mso-bidi-font-size: 10.5pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">This is with Weiqiang Ren's help.<o:p></o:p></font></span></p><img src ="http://www.cppblog.com/guijie/aggbug/207643.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2014-07-14 15:47 <a href="http://www.cppblog.com/guijie/archive/2014/07/14/207643.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]Matlab图形中显示数学公式</title><link>http://www.cppblog.com/guijie/archive/2013/11/02/204063.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sat, 02 Nov 2013 12:00:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/11/02/204063.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/204063.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/11/02/204063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/204063.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/204063.html</trackback:ping><description><![CDATA[<div><a href="http://blog.sina.com.cn/s/blog_401aa0540100ufl1.html">http://blog.sina.com.cn/s/blog_401aa0540100ufl1.html</a><br /><br />Matlab 绘图时， 可以通过 设置 "interpreter" 属性 显示数学公式。</div>
<div>E.g.</div>
<div>xlabel('$n$','interpreter','latex');</div>
<div>ylabel('${\gamma}$','interpreter','latex');</div>
<div>title('${\gamma}(n)$','interpreter','latex');</div>
<div>text(0.5,0.5, '$\int_{a}^{b}f(x)dx$', 'interpreter','latex');<br /><br /><span style="color: red">例1：</span>我的程序Flicker.m (<span style="color: red">所有字体都是Latex)</span> 
<div>h = legend('ours','$l_p$-norm MKL',1);</div>
<div>set(h,'Interpreter','latex');<br /><br /><span style="color: red">例2：</span>我的程序AR_Sparse.m (<span style="color: red">仅仅公式字体是latex)</span><br />
<div>h = legend('l1','DLSR-FS',4);</div>
<div>h1 = findobj(get(h,'Children'),'String','l1');</div>
<div>set(h1,'String','$l_1$','Interpreter','LaTex');<br /><br />---------------------------如何在matlab中的xlabel，ylabel，legend和text函数中使用latex(<span style="color: red">以下关于legend的不必看，已到我的例二</span>)---------------------------<br />http://blog.sina.com.cn/s/blog_6e0693f70100nj22.html<br />以下例子中展示了如何用在matlab函数中使用latex<br />t = 0:0.1:2*pi;
<div>x = sin(t);</div>
<div>hold on;</div>
<div>plot(t,x,'-*');</div>
<div>plot(t,2*x,'-.');</div>
<div>%% Using Latex in xlabel and ylabel</div>
<div>xlabel('$Time$','Interpreter','LaTex');</div>
<div>ylabel('$Value$','Interpreter','LaTex');</div>
<div>%% Using Latex in legend</div>
<div>h = legend('sin(x)__','2*sin(x)__');</div>
<div>h1 = findobj(get(h,'Children'),'String','sin(x)__');</div>
<div>set(h1,'String','$sin(\hat{x})$','Interpreter','LaTex');</div>
<div>h2 = findobj(get(h,'Children'),'String','2*sin(x)__');</div>
<div>set(h2,'String','$2*sin(\hat{x})$','Interpreter','LaTex');</div>
<div>%% Using Latex in text</div>
<div>text('Interpreter','latex',...</div>
<div>&nbsp;'String','$$\int_0^x\!\int_y dF(u,v)$$',...</div>
<div>&nbsp;'Position',[3 1],...</div>
<div>&nbsp;'FontSize',16);</div>
<div>%% Using Latex in title</div>
<div>title('$How \ to \ use \ latex \ in \ figure$','Interpreter','LaTex');</div></div></div></div><img src ="http://www.cppblog.com/guijie/aggbug/204063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-11-02 20:00 <a href="http://www.cppblog.com/guijie/archive/2013/11/02/204063.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>元胞(cell)与结构体(struct)</title><link>http://www.cppblog.com/guijie/archive/2013/09/21/203326.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sat, 21 Sep 2013 03:31:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/09/21/203326.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/203326.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/09/21/203326.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/203326.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/203326.html</trackback:ping><description><![CDATA[<span style="color: red">元胞数组cell array</span><br />
<div>Element:cell;以下标index访问cell，以元胞内编址content addressing访问元胞内容；cell中可以存放任何类型，任何大小的数组</div>
<div></div>
<div><span style="color: red">cell的创建</span></div>
<div>cell()%创建元胞数组</div>
<div>c=cell(2);%创建2&#215;2的</div>
<div>c=cell(m,n);%创建m&#215;n的,用cell函数创建元胞数组，创建的数组为空元胞。<span style="color: red">cell函数创建空元胞数组的主要目的是为数组预先分配连续的存储空间，节约内存占用，提高执行效率。同cppblog/MATLAB程序的优化、预先分配存储空间</span></div>
<div>c_str=char('This is cell array');c_R=rand(3,3);c_comp=1+2i;c_sym=sym('sin(-3*t)*exp(-t)');</div>
<div></div>
<div><span style="color: red">两种赋值方式：index赋值和content addressing赋值</span></div>
<div>index赋值：A(1,1)={c_str};A(1,2)={c_R};A(2,1)={c_comp};A(2,2)={c_sym};</div>
<div>content addressing赋值:B{1,1}=c_str;B{1,2}=c_R;B{2,1}=c_comp;B{2,2}=c_sym;% The class({c_str}) and class(c_str) are cell and string, respectively.<br /><br />cell array的访问<br />B{1,2}<br />B{1,2}(1,2)<br /><br /><span style="color: red">问题：</span><span style="white-space: normal; text-transform: none; word-spacing: 0px; float: none; color: #000000; font: 13px 微软雅黑, 'MS Sans Serif', sans-serif; display: inline !important; letter-spacing: normal; text-indent: 0px; -webkit-text-stroke-width: 0px">我有一个cell变量。比方说3*1的size&nbsp;&nbsp;每一个里面存了一个1✘9的矩阵。matlab中有没有快速的语句把每一个1*9的矩阵，reshape成3*3的矩阵。也就是说对一个cell变量中的每一个元素(应该是一个矩阵)进行reshape操作。当然不想用循环做。<br /></span><span style="white-space: normal; text-transform: none; word-spacing: 0px; float: none; color: red; font: 13px 微软雅黑, 'MS Sans Serif', sans-serif; display: inline !important; letter-spacing: normal; text-indent: 0px; -webkit-text-stroke-width: 0px">答案：</span><span style="white-space: normal; text-transform: none; word-spacing: 0px; float: none; color: #000000; font: 13px 微软雅黑, 'MS Sans Serif', sans-serif; display: inline !important; letter-spacing: normal; text-indent: 0px; -webkit-text-stroke-width: 0px">A&nbsp;=&nbsp;{rand(1,9),rand(1,9),rand(1,9)}; cellfun(@(x)&nbsp;reshape(x,&nbsp;3,&nbsp;3).',&nbsp;A,&nbsp;'UniformOutput',&nbsp;false)&nbsp; <br /><br /></span><span style="white-space: normal; text-transform: none; word-spacing: 0px; float: none; color: red; font: 13px 微软雅黑, 'MS Sans Serif', sans-serif; display: inline !important; letter-spacing: normal; text-indent: 0px; -webkit-text-stroke-width: 0px">cell转化成矩阵的函数cell2mat<br /></span><span style="white-space: normal; text-transform: none; word-spacing: 0px; float: none; color: #000000; font: 13px 微软雅黑, 'MS Sans Serif', sans-serif; display: inline !important; letter-spacing: normal; text-indent: 0px; -webkit-text-stroke-width: 0px">例：A = {rand(1,9),rand(1,9),rand(1,9)};cell2mat(A)</span></div>
<div></div>
<div></div>
<div><span style="color: red">结构体数组 structure array</span></div>
<div>Element:structure</div>
<div>域访问</div>
<div>域中可以存放任何类型、任何大小的数组</div>
<div>类C</div>
<div>cell和struct的转换cell2struct.<br /><br /><span style="color: red">Matlab提供了两种定义结构的方式：直接应用和使用struct函数。</span><br /><span style="color: red">1. 使用直接引用方式定义结构</span><br />与建立数值型数组一样，建立新struct对象不需要事先申明，可以直接引用，而且可以动态扩充。比如建立一个复数变量x：<br />x.real = 0; % 创建字段名为real，并为该字段赋值为0<br />x.imag = 0 % 为x创建一个新的字段imag，并为该字段赋值为0 <br />x = <br />real: 0<br />imag: 0 <br />然后可以将旗动态扩充为数组：<br />x(2).real = 0; % 将x扩充为1&#215;2的结构数组<br />x(2).imag = 0; <br />在任何需要的时候，也可以为数组动态扩充字段，如增加字段scale：<br />x(1).scale = 0; <br />这样，所有x都增加了一个scale字段，而x(1)之外的其他变量的scale字段为空：<br />x(1) % 查看结构数组的第一个元素的各个字段的内容 <br />ans = <br />real: 0<br />imag: 0<br />scale: 0 <br /><span style="color: red">2. 使用struct函数创建结构</span><br />使用struct函数也可以创建结构，该函数产生或吧其他形式的数据转换为结构数组。<br />struct的使用格式为：<br />s = sturct('field1',values1,'field2',values2,&#8230;);<br />该函数将生成一个具有指定字段名和相应数据的结构数组，其包含的数据values1、valuese2等必须为具有相同维数的数据，数据的存放位置域其他结构位置一一对应的。对于struct的赋值用到了元胞数组。数组values1、values2等可以是元胞数组、标量元胞单元或者单个数值。每个values的数据被赋值给相应的field字段。<br />当valuesx为元胞数组的时候，生成的结构数组的维数与元胞数组的维数相同。而在数据中不包含元胞的时候，得到的结构数组的维数是1&#215;1的。例如：<br />s = struct('type',{'big','little'},'color',{'blue','red'},'x',{3,4}) <br />s = <br />1x2 struct array with fields:<br />type<br />color<br />x <br /><br /><span style="color: red">参考文献：</span><a href="http://blog.sciencenet.cn/blog-436588-320694.html">http://blog.sciencenet.cn/blog-436588-320694.html</a></div><img src ="http://www.cppblog.com/guijie/aggbug/203326.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-09-21 11:31 <a href="http://www.cppblog.com/guijie/archive/2013/09/21/203326.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab fscanf</title><link>http://www.cppblog.com/guijie/archive/2013/09/13/203214.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 13 Sep 2013 06:34:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/09/13/203214.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/203214.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/09/13/203214.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/203214.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/203214.html</trackback:ping><description><![CDATA[<span style="color: red; font-family: tahoma, helvetica, arial; background-color: #ffffff;"></span><span style="color: #ff0000; font-family: tahoma, helvetica, arial; background-color: #ffffff;">结合我的教材P31<br /></span><div>matlab文件操作：见电脑目录Blessing of Dimensionality\Features\code\readFea.m 和 findImsFeaIdx.m</div><a href="http://blog.sina.com.cn/s/blog_4cfb5a6201015i8q.html">http://blog.sina.com.cn/s/blog_4cfb5a6201015i8q.html<br /></a><br /><span style="color: red; font-family: tahoma, helvetica, arial; background-color: #ffffff;">例1：<br /></span><span style="color: #000000; font-family: tahoma, helvetica, arial; background-color: #ffffff;">路径+文件名：d:\moon.txt</span><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;"><br /></span><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;">内容：<br /></span><div>13,1,3.4</div><div>3,2.1,23</div><div>1,12,2</div>4,5.4,6<br /><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;">现在为了读取moon中的数据存在一个数组里，可以用如下方法</span><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;">fid=fopen('d:\moon.txt');</span><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;">data=fscanf(fid,'%f,%f,%f',[3,inf]) ;%这里得用单引号</span><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;">fclose(fid);</span><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><span style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;">这时data中的数据如下：</span><br style="color: #454545; font-family: tahoma, helvetica, arial; background-color: #ffffff;" /><div>13<span style="white-space:pre">	</span>3<span style="white-space:pre">	</span>1<span style="white-space:pre">	</span>4</div><div>1<span style="white-space:pre">	</span>2.1<span style="white-space:pre">	</span>12<span style="white-space:pre">	</span>5.4</div><div>3.4<span style="white-space:pre">	</span>23<span style="white-space:pre">	</span>2<span style="white-space:pre">	</span>6<br /><br /><span style="color: red;">例2：<br /></span><span style="color: red;">数据在d:\test.txt</span><br /><div>0.00 &nbsp; &nbsp;good 2</div><div>0.10 &nbsp; &nbsp;bot 3</div><div>1.02 &nbsp; &nbsp;yes 4</div><div>1.00 &nbsp; &nbsp;yes 5</div><div>1.00 &nbsp; &nbsp;yes 6</div><div>1.00 &nbsp; &nbsp;yes 3</div><div>1.00 &nbsp; &nbsp;yes 5</div><div>1.00 &nbsp; &nbsp;yes 6</div><div>1.00 &nbsp; &nbsp;yes 1</div><div>1.00 &nbsp; &nbsp;yes 3</div><div>1.00 &nbsp; &nbsp;yes 7</div><div>1.00 &nbsp; &nbsp;yes 3</div><div>1.00 &nbsp; &nbsp;yes 2<br /><br /><span style="color: red;">程序：</span></div><div>fid = fopen('d:\test.txt', 'r');</div><div>a = fscanf(fid, '%f &nbsp; &nbsp;%*s %d ', [2 inf]) &nbsp; &nbsp;% It has two rows now.</div><div>fclose(fid);<br />a</div><div><span style="color: red;">解释下</span>：第一列和第二列之间有四个空格，<span style="color: red;">format也要四空格哦</span>！有三列即三种类型，要有三种format，<span style="color: red;">%*s即为不输出字符串型。<br /></span></div><br /><div>fid = fopen('E:\temp\test.txt', 'r');</div><div>a = fscanf(fid, '%f &nbsp; &nbsp;%*s %*f ', 5) &nbsp; &nbsp;% It has five rows and one column now.&nbsp;<span style="color: red;">%*s %*f 即这两个不输出</span></div><div>fclose(fid);<br />a<br /><br />程序结果为：<br /><div>a =</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0</div><div>&nbsp; &nbsp; 0.1000</div><div>&nbsp; &nbsp; 1.0200</div><div>&nbsp; &nbsp; 1.0000</div><div>&nbsp; &nbsp; 1.0000</div></div></div><div></div><img src ="http://www.cppblog.com/guijie/aggbug/203214.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-09-13 14:34 <a href="http://www.cppblog.com/guijie/archive/2013/09/13/203214.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab中对角阵的存储，diag vs spdiags</title><link>http://www.cppblog.com/guijie/archive/2013/07/07/201586.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sun, 07 Jul 2013 03:39:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/07/07/201586.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/201586.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/07/07/201586.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/201586.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/201586.html</trackback:ping><description><![CDATA[<div><span style="color: #5e5e5e; font-family: Verdana, Helvetica, Arial; font-size: 13px; line-height: 18px; text-align: justify; background-color: #ffffff;">Feiping Nie的NIPS 2010公布代码L21R21第44行用的</span>D = spdiags(d,0,n,n);可用D =diag(d)实现类似功能，但可能效率更低，在54服务器FRGC 30Train，前者耗时22秒，后者耗时53秒。因为前者采用稀疏存储，更节省内存。Nie老师讲：<span style="font-family: Helvetica, 'Microsoft Yahei', verdana; line-height: 23px;">功能相同，但由于是sparse的矩阵，矩阵很大时会快很多。</span><br />简单例子：<br />p=[1 2 3]; D1=diag(p);D2 = &nbsp;spdiags(p',0,3,3);</div><img src ="http://www.cppblog.com/guijie/aggbug/201586.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-07-07 11:39 <a href="http://www.cppblog.com/guijie/archive/2013/07/07/201586.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>matlab高效实现矩阵乘以对角阵</title><link>http://www.cppblog.com/guijie/archive/2013/07/04/201514.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Thu, 04 Jul 2013 06:28:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/07/04/201514.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/201514.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/07/04/201514.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/201514.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/201514.html</trackback:ping><description><![CDATA[<div>[dim,num]=size(Data);weight是一个1&#215;num的行向量，够成一个对角阵P=diag(weight);目标：实现Data*P<br /><span style="color: red;">方式一</span>：Data*diag(weight)，这种需要dim&#215;num&#215;(2num-1)个加法或乘法；<br /><span style="color: red;">方式二</span>：Data.*repmat(weight,dim,1)，这种只需要dim&#215;num个乘法。<br />这就是Ran He的CVPR 12代码CRFS第31行用:X1 = Data.*repmat(weight,dim,1)实现Data*P的原因。</div><img src ="http://www.cppblog.com/guijie/aggbug/201514.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-07-04 14:28 <a href="http://www.cppblog.com/guijie/archive/2013/07/04/201514.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>能不用inv尽量不用</title><link>http://www.cppblog.com/guijie/archive/2013/07/03/201500.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Wed, 03 Jul 2013 14:47:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/07/03/201500.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/201500.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/07/03/201500.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/201500.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/201500.html</trackback:ping><description><![CDATA[Ran He老师讲他CVPR 2012公式20不是用inv求的，他和学生说过能不用inv，尽量不用，用左除或者右除，解线性方程组。不能受我matlab教材影响，左除或者右除和求inv是不等价的。Feiping Nie的NIPS 2010公布代码L21R21第45行<span style="color: red;">实现一个矩阵的逆乘以另外一个矩阵，也用右除。类似实现一个矩阵乘以另外一个矩阵的逆，用左除，不用inv</span><br /><br /><div>http://zhidao.baidu.com/question/308277515.html</div><div>左除要不要求矩阵可逆？为什么一个不可逆的矩阵a在matlaB中用inv（a）*y不可计算，用a\y就可以计算了？</div><div>答：左除不要求矩阵可逆，在matlab中inv（a）*y与a\y并不等同，左除命令有更深的内涵，当a为方阵且可逆时，二者都能得到正确结果，但<span style="color: red;">左除精度更高，运算数度快(我实验下来，确实是这样)</span>，特别当A为病态矩阵时，inv(A)*y的计算结果不可靠（不过这种矩阵出现的概率很低），但用左除计算出的结果却很可靠，因为左除是matlab设计的一个智能算符，他可以智能地选择算法；当方程为矛盾方程（也就是独立方程个数多余未知数个数）时，此时显然没有精确解，但很多时候我们需要x在最小二乘意义下的解，此时用A\y就能得到x的最小二乘解。<br /><br />Haiqing Li说他从来不看这些中文的，有些人可能回答得不专业或误解，到matlab帮助搜索arithmetic operators有左除或者右除详细解释<br /><br />测试例子：<br /><span style="color: red;">第一个matlab的m文件</span><br /><div>% 生成数据</div><div>rand('state',0);</div><div>n = 10000;% 也可设置为1000</div><div>A = randn(n,n);</div><div>B = randn(n,1);</div><div>save MyFile1 A B;<br /><br /><span style="color: red;">第二个matlab的m文件</span></div><div></div><div>% 测试求逆时间</div><div>tic;</div><div>load MyFile1;</div><div>n = size(A,1);</div><div>C1 = inv(A'*A+0.01*eye(n))*B;</div><div>save MyFile2 C1;</div><div>toc;<br /><br /><span style="color: red;">第三个matlab的m文件</span></div><div></div><div>% 测试左除时间</div><div>tic;</div><div>load MyFile1;</div><div>n = size(A,1);</div><div>C2 = (A'*A+0.01*eye(n))\B;</div><div>save MyFile3 C2;</div><div>toc;</div></div><img src ="http://www.cppblog.com/guijie/aggbug/201500.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-07-03 22:47 <a href="http://www.cppblog.com/guijie/archive/2013/07/03/201500.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何用matlab求矩阵的最大奇异值？(Matlab code to solve the largest singular value of a matrix)</title><link>http://www.cppblog.com/guijie/archive/2013/05/03/199950.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 03 May 2013 13:44:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2013/05/03/199950.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/199950.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2013/05/03/199950.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/199950.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/199950.html</trackback:ping><description><![CDATA[<div>n = norm(A) returns the largest singular value of A, max(svd(A)).</div><img src ="http://www.cppblog.com/guijie/aggbug/199950.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2013-05-03 21:44 <a href="http://www.cppblog.com/guijie/archive/2013/05/03/199950.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>combntns函数所引起的内存不足问题</title><link>http://www.cppblog.com/guijie/archive/2012/12/13/196200.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Thu, 13 Dec 2012 00:30:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2012/12/13/196200.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/196200.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2012/12/13/196200.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/196200.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/196200.html</trackback:ping><description><![CDATA[<p style="font-family: 宋体; line-height: 21.33333396911621px; background-color: #ffffff;">编写NFL和NFP分类器应用于ASLAN数据库发现combntns函数所引起的内存不足，到网上搜索有人提问，但没有解决方案。<br /><span style="color: red;">问题</span>：我想取一个序列的任意组合，用combntns，在数目较小时，可以达到目的，但是数目变大时，就不行了，求助各位。</p><p style="font-family: 宋体; line-height: 21.33333396911621px; background-color: #ffffff;">例如取1:5,里面3个数字的组合，很容易得到。<br />combntns(1:5,3) 就可以了</p><p style="font-family: 宋体; line-height: 21.33333396911621px; background-color: #ffffff;">但是取1:100里面10个数字的组合，就不行了。<br /><span style="color: red;">我的解决方案：</span><span style="color: #000000;">如果你未必要取所有组合，可以从1：100中任取20个数，再取这20个数字里面10个数字的组合。<br />%matlab code:</span><br /><div>rand('state',0);</div><div>temp1 = randperm(100);</div><div>temp2 = temp1(1:20);</div><div>combntns(temp2,10)</div></p><img src ="http://www.cppblog.com/guijie/aggbug/196200.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2012-12-13 08:30 <a href="http://www.cppblog.com/guijie/archive/2012/12/13/196200.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>win7下matlab7.0的卸载问题,为什么matlab2010a只能在断网时才能打开？</title><link>http://www.cppblog.com/guijie/archive/2012/12/05/196015.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Wed, 05 Dec 2012 11:32:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2012/12/05/196015.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/196015.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2012/12/05/196015.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/196015.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/196015.html</trackback:ping><description><![CDATA[<span style="color: #444444; font-family: Tahoma, 'Microsoft Yahei', Simsun; background-color: #ffffff;"></span><div><div>http://www.ilovematlab.cn/thread-68860-1-1.html</div>在win7，32位家庭版下,有两种方法解决正常运行问题，一是将配色方案改为经典(在桌面空白处右击鼠标，选择个性化，在弹出的对话框中选择windows经典主题即可)，二是兼容性改为vista sp1或sp2.<span style="background-color: #ffffff; color: #444444; font-family: Tahoma, 'Microsoft Yahei', Simsun;">卸载完了后，再把主题改回到你原来的主题。<br /><br /></span><div><span style="color: red;">为什么matlab2010a只能在断网时才能打开？</span><br />20121207发现matlab打不开，上网搜索解决方案。有人说断网就可以。我实验两次，注销后断网能打开matlab，注销后连网，不打开其他任何程序，matlab还是打不开，等了五分钟。能看到matlab进程。继续搜索&#8220;Windows 7 matlab断网才能打开&#8221;。查到解决方案(http://wenwen.soso.com/z/q294348187.htm)：<span style="font-family: Arial, Helvetica, sans-serif, SimSun; line-height: 22px;">你可能用的是window7吧，这种现象的产生是由于MatLab与Windows 7&nbsp;的兼容性问题，解决的方法如下：从纯净的Windows XP系统中system32目录中拷贝一份iphlpapi.dll到 Matlab&nbsp;2010a安装目录\bin\win32中问题即可解决，当然，X64的系统要到 Windows XP X64 中去拷。我问Lianyang Ma要了这个文件，重启下电脑就搞好了(即使在同时打开qq,gtalk,谷歌浏览器,</span>FileZilla的情况下，也能打开matlab<span style="font-family: Arial, Helvetica, sans-serif, SimSun; line-height: 22px;">)。 &nbsp; &nbsp;与</span>配色方案和兼容性没有关系。</div></div><img src ="http://www.cppblog.com/guijie/aggbug/196015.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2012-12-05 19:32 <a href="http://www.cppblog.com/guijie/archive/2012/12/05/196015.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to use matlab solve optimization quadratic?</title><link>http://www.cppblog.com/guijie/archive/2012/11/21/195475.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Wed, 21 Nov 2012 10:31:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2012/11/21/195475.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/195475.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2012/11/21/195475.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/195475.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/195475.html</trackback:ping><description><![CDATA[Nannan gives me a fold named "Matlab Help". On page 46 of "Optimization Toolbox User Guide", it lists the constrain and objective type, and the matlab function. For example, if the constrain is linear and the objective is quadratic, we can use quadprog. Note that it can not slove $D_1$ in Section 4.1 of "Smooth minimization of non-smooth functions". Problem: max ((X^T)HX) and H is positive semi definite. The matlab function "quadratic" can not solve this kind of problem. It can only solve the problem: min ((X^T)HX) and H is positive&nbsp;semi definite.<img src ="http://www.cppblog.com/guijie/aggbug/195475.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2012-11-21 18:31 <a href="http://www.cppblog.com/guijie/archive/2012/11/21/195475.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to compile the mexfile?</title><link>http://www.cppblog.com/guijie/archive/2012/10/18/193450.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Thu, 18 Oct 2012 00:27:00 GMT</pubDate><guid>http://www.cppblog.com/guijie/archive/2012/10/18/193450.html</guid><wfw:comment>http://www.cppblog.com/guijie/comments/193450.html</wfw:comment><comments>http://www.cppblog.com/guijie/archive/2012/10/18/193450.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/guijie/comments/commentRss/193450.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/guijie/services/trackbacks/193450.html</trackback:ping><description><![CDATA[<div>An Efficient Projection for l1,&#8734; Regularization该文提供代码，在Readme文件中说To run the projection in Matlab, you first need to compile the mexfile:</div>
<div>$ mex -output projL1Inf mex-projL1Inf.c&nbsp;</div>
<div>Then, from Matlab, test the projection by running the script "runprojection",&nbsp;<br /><br />(1)在我笔记本电脑，打开matlab，打开该程序所在的文件夹，在matlab命令行输入mex -setup，<span style="color: red">matlab输出：</span>Would you like mex to locate installed compilers [y]/n? <span style="color: red">手动输入：</span>y&nbsp;，<span style="color: red">matlab输出</span>：&nbsp;<br />Select a compiler:&nbsp;&nbsp;<span style="color: red">手动输入：1,</span> <span style="color: #ff0000">matlab输出：</span>&nbsp;Are these correct [y]/n?&nbsp;<span style="color: red">&nbsp;</span> <span style="color: red">手动输入：</span>y 。<span style="color: #ff0000">手动输入：</span> mex -output projL1Inf mex-projL1Inf.c ，可能是因为我的笔记本电脑没装VC，有错误。在我本机要能运行，关键就是生成<span style="color: #ff0000">projL1Inf.mexw32</span><span style="color: #000000">这个文件就可以了，在Mingming Gong电脑上生成，拷贝到我的电脑就可以了。</span>&nbsp;Mingming电脑装VC了，但还是不能编译，他讲可能原因是这个c语言代码本来就是在linux下写的，在windows上跑不了，naiyang也这么说。<span style="color: red">20121023, after Mingming Gong saw my blog, he found the solution to produce the file&nbsp;projL1Inf.mexw32</span>. 只要将mex-projL1Inf.c后缀改为mex-projL1Inf.cpp，projL1Inf.c后缀改为projL1Inf.cpp，mex-projL1Inf.cpp第39行改为#include "projL1Inf.cpp"，只要修改这三点就可以在windows下编译，我已经从他那里拷贝了<strong>projL1Inf.mexw32</strong>&nbsp;。从我本机还是不能编译，因为本机没装VC。<span style="color: #ff0000">原</span><span style="color: #ff0000">因：</span><span style="color: #000000">*.cpp是支持C和C++的；</span><span style="color: #000000">*.c只支持C，故//不支持。在Linux下C和</span>C++是两个编译器(在linux下c是用gcc编译，C++使用g++编译)，在windows下，C和C++是可以同时用VC编译的。<br /><br />20130629在NLPR的54服务器用mex -output projL1Inf mex-projL1Inf.cpp成功编译生成文件projL1Inf.mexw64，不知为什么用mex -setup一步一步来不行。<br /><br />(2)在uts cluster，按照上面输入的命令，有错误和警告 (Mingming said that the warning does not matter)<br />
<div><span style="color: red">Warning</span>: You are using gcc version "4.4.6". &nbsp;The version</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;currently supported with MEX is "4.3.4".&nbsp;</div><span style="color: red">错误</span>：projL1Inf.c:248: error: expected expression before '/' token
<div>projL1Inf.c:250: error: expected expression before '/' token</div>
<div>projL1Inf.c:252: error: expected expression before '/' token</div>打开projL1Inf.c ，将这三行的注释//，均换成/*&nbsp;*&nbsp;/&nbsp;<br />这样的作用，就是生成<span style="color: red">projL1Inf.mexa64</span>这个文件.如果用命令mex mex-projL1Inf.c,就是生成<span style="color: red">mex-projL1Inf.</span><span style="color: red">mexa64 (已经实践，</span><span style="color: #000000">将原始</span> <span style="color: #000000">projL1Inf.mexa64</span><span style="color: #000000">&nbsp;</span>删除，用命令mex mex-projL1Inf.c,就是生成<span style="color: #000000">mex-projL1Inf.</span><span style="color: #000000">mexa64，</span>&nbsp;再将这个文件改名为projL1Inf.mexa64，再运行runprojection 还是可以的)<br /><br />
<div><span style="color: red">20121208在uts服务器编译libsvm-mat-2.9-1</span>，编译有问题，根据提示，将所有文件*.c都变成*.cpp,还有问题g++: svm.obj: No such file or directory，上网搜索解决方案http://blog.csdn.net/kit_147/article/details/7417734，将文件svm.obj改为svm.o，编译就没有问题了，但用程序测试还有问题，提示 "-largeArrayDims"的问题，make.m开始注释：% add -largeArrayDims on 64-bit machines，问mingming gong怎么add？将makefile中的mex...修改为mex...-largeArrayDims即可。例如<br />
<div>mex -O -c svm.cpp&nbsp;</div>
<div>mex -O -c svm_model_matlab.c&nbsp;<br /><span style="color: red">修改为</span><br />
<div>mex -O -c svm.cpp -largeArrayDims</div>
<div>mex -O -c svm_model_matlab.c -largeArrayDims</div></div></div>(This is with Mingming Gong's help)<br /><br />20150710在跑FastHash提示错误：binaryTreeTrain1.mexw64不是有效的w32应用程序,感到费解，这是64位机，怎么会提示这个错误。Jian Liang讲重新编译下就行了，他就在matlab窗口敲入mex binaryTreeTrain1.cpp，再敲入mex forestInds.cpp就可以了</div><img src ="http://www.cppblog.com/guijie/aggbug/193450.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/guijie/" target="_blank">杰哥</a> 2012-10-18 08:27 <a href="http://www.cppblog.com/guijie/archive/2012/10/18/193450.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>