??xml version="1.0" encoding="utf-8" standalone="yes"?>av午夜福利一片免费看久久,人妻丰满?V无码久久不卡,久久99国产精品成人欧美http://www.shnenglu.com/guijie/category/13862.html杰哥?哈哈!zh-cnWed, 08 Jun 2022 22:40:13 GMTWed, 08 Jun 2022 22:40:13 GMT60How to read *.data in Matlab and Pythonhttp://www.shnenglu.com/guijie/archive/2018/10/13/216005.html杰哥杰哥Fri, 12 Oct 2018 20:33:00 GMThttp://www.shnenglu.com/guijie/archive/2018/10/13/216005.htmlhttp://www.shnenglu.com/guijie/comments/216005.htmlhttp://www.shnenglu.com/guijie/archive/2018/10/13/216005.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/216005.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/216005.htmlSee P2 of "HW2_545_2018_"

In Matlab:
z = dlmread('spambase.data',',');
In Python:
import numpy as np
z = np.genfromtxt('spambase.data', dtype=float, delimiter=',')


杰哥 2018-10-13 04:33 发表评论
]]>
matlab legend字号改变http://www.shnenglu.com/guijie/archive/2017/12/19/215431.html杰哥杰哥Mon, 18 Dec 2017 20:50:00 GMThttp://www.shnenglu.com/guijie/archive/2017/12/19/215431.htmlhttp://www.shnenglu.com/guijie/comments/215431.htmlhttp://www.shnenglu.com/guijie/archive/2017/12/19/215431.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215431.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215431.htmlhleg1 = legend('SBQ','DBQ','IBQ',4);
set(hleg1,'Interpreter','none');
set(hleg1,'FontSize',15); 

set(gca,'linewidth',2);
set(gca,'FontName','Times New Roman','FontSize',12);
set(gca,'xtick',[16 32 64 128]);

This is with Yuan Cao's help.

杰哥 2017-12-19 04:50 发表评论
]]>
[转蝲]matlab中text 函数在显C字W串时的使用Ҏhttp://www.shnenglu.com/guijie/archive/2017/12/17/215429.html杰哥杰哥Sun, 17 Dec 2017 04:53:00 GMThttp://www.shnenglu.com/guijie/archive/2017/12/17/215429.htmlhttp://www.shnenglu.com/guijie/comments/215429.htmlhttp://www.shnenglu.com/guijie/archive/2017/12/17/215429.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215429.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215429.html原文地址Q?/strong>matlab中text 函数在显C字W串时的使用Ҏ作者:gypsy

matlab中text 函数在显C字W串时的使用Ҏ

 功能 在当前u中创建text对象。函数text是创建text囑Ş句柄的低U函数。可用该函数在图形中指定的位|上昄字符丌Ӏ?/p>

用法 text(x,y,'string')在图形中指定的位|?x,y)上显C字W串string

text(x,y,z,'string') 在三l图形空间中的指定位|?x,y,z)上显C字W串string

text(x,y,z,’string’.'PropertyName',PropertyValue…) 对引号中的文字string定位于用坐标轴指定的位置Q且Ҏ定的属性进行设|。表7-6l出文字属性名、含义及属性倹{?/p>

?-6

属性名

属性说?/p>

属性?/p>

定义字符?/p>

Editing

能否Ҏ字进行编?/p>

有效|on、off

~省|off

Interpretation

TeX字符是否可用

有效|tex、none

~省|tex

String

字符?包括TeX字符?

有效|可见字符?/p>

攄字符?/p>

Extent

text对象的范_位置与大)

有效|[left, bottom, width, height]

HorizontalAlignment

文字水^方向的对齐方?/p>

有效|left(文本外框左边寚wQ缺省对齐方?、center(文本外框中间寚w)、right(文本外框双寚w)

~省|left

Position

文字范围的位|?/p>

有效|[x,y,z]直角坐标p?/p>

~省|[]Q空矩阵Q?/p>

Rotation

文字对象的方位角?/p>

有效|标量Q单位ؓ度)

~省|0

Units

文字范围与位|的单位

有效|pixels (屏幕上的像素?、normalized (把屏q看成一个长、宽?的矩?、inches(英寸)、centimeters(厘米)、points (图象?、data

~省|data

VerticalAlignment

文字垂直方向的对齐方?/p>

有效|top (文本外框上寚w)、cap(文本字符上寚w)、middle(文本外框中间寚w)、baseline(文本字符底线?、bottom(文本外框底线寚w)

~省|middle

指定文字字体

FontAngle

讄斜体文字模式

有效|normal(正常字体)、italic(斜体?、oblique(斜角?

~省|normal

FontName

讄文字字体名称

有效|用户pȝ支持的字体名或者字W串FixedWidth?/p>

~省gؓ Helvetica

FontSize

文字字体大小

有效|l合字体单位的数?/p>

~省gؓQ?0 points

FontUnits

讄属性FontSize的单?/p>

有效|points (1?1/72英寸)、normalized(把父对象坐标轴作Z单位长的一个整体;当改变坐标u的尺寸时Q系l会自动改变字体的大?、inches (英寸)、Centimeters(厘米)、Pixels(像素)

~省|points

FontWeight

讄文字字体的粗l?/p>

有效|light(l字?、normal(正常字体)、demi(黑体?、Bold(黑体?

~省|normal

控制文字外观

Clipping

讄坐标轴中矩Ş的剪辑模?/p>

有效|on、off

onQ当文本出坐标轴的矩ŞӞ出的部分不昄Q?/p>

offQ当文本出坐标轴的矩ŞӞ出的部分显C?/p>

~省|off

EraseMode

讄昄与擦除文字的模式。这些模式对生成动画pd与改q文字的昄效果很有好处?/p>

有效|normal、none?xor?background

~省|normal

SelectionHighlight

讄选中文字是否H出昄

有效|on、off

~省|on

Visible

讄文字是否可见

有效|on、off

~省|on

Color

讄文字颜色

有效的颜色|ColorSpec

控制Ҏ字对象的讉K

HandleVisibility

讄文字对象句柄对其他函数是否可?/p>

有效|on、callback、off

~省|on

HitTest

讄文字对象能否成ؓ当前对象Q见囑ŞCurrentObject属性)

有效|on、off

~省|on

文字对象的一般信?/p>

Children

文字对象的子对象Q文字对象没有子对象Q?/p>

有效|[]Q即I矩阵)

Parent

文字对象的父对象Q通常为axes对象Q?/p>

有效|axes的句?/p>

Seleted

讄文字是否昄?#8220;选中”状?/p>

有效|on、off

~省|off

Tag

讄用户指定的标{?/p>

有效|M字符?/p>

~省|’’Q即I字W串Q?/p>

Type

讄囑Ş对象的类型(只读cdQ?/p>

有效|字符?#8217;text’

UserData

讄用户指定数据

有效|M矩阵

~省|[]Q即I矩阵)

控制回调例行执行E序

BusyAction

讄如何处理Ҏ字回调过E中断的句柄

有效|cancel、queue

~省|queue

ButtonDownFcn

讄当鼠标在文字上单LQ程序做出的反应Q即执行回调E序Q?/p>

有效|字符?/p>

~省|' 'Q空字符Ԍ

CreateFcn

讄当文字被创徏ӞE序做出的反应(x行的回调E序Q?/p>

有效|字符?/p>

~省|' 'Q空字符Ԍ

DeleteFcn

讄当文字被删除Q通过关闭或删除操作)ӞE序做出的反应(x行的回调E序Q?/p>

有效|字符?/p>

~省|' 'Q空字符Ԍ

Interruptible

讄回调q程是否可中?/p>

有效|on、off

~省|onQ能中断Q?/p>

UIContextMenu

讄与文字相关的菜单?/p>

有效|用户相关菜单句柄

 

MATLAB资源|:http://www.ymlib.net/article/sort010/info-276.html
http://blog.sciencenet.cn/blog-711035-566055.html


杰哥 2017-12-17 12:53 发表评论
]]>
matlab ColorSpec (Color Specification)http://www.shnenglu.com/guijie/archive/2017/12/10/215417.html杰哥杰哥Sat, 09 Dec 2017 18:27:00 GMThttp://www.shnenglu.com/guijie/archive/2017/12/10/215417.htmlhttp://www.shnenglu.com/guijie/comments/215417.htmlhttp://www.shnenglu.com/guijie/archive/2017/12/10/215417.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215417.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215417.html

RGB Triplet

Short Name

Long Name

[1 1 0]

y

yellow

[1 0 1]

m

magenta

[0 1 1]

c

cyan

[1 0 0]

r

red

[0 1 0]

g

green

[0 0 1]

b

blue

[1 1 1]

w

white

[0 0 0]

k

black



杰哥 2017-12-10 02:27 发表评论
]]>
Professor Deng Cai's code, very good codehttp://www.shnenglu.com/guijie/archive/2017/11/26/215370.html杰哥杰哥Sun, 26 Nov 2017 05:10:00 GMThttp://www.shnenglu.com/guijie/archive/2017/11/26/215370.htmlhttp://www.shnenglu.com/guijie/comments/215370.htmlhttp://www.shnenglu.com/guijie/archive/2017/11/26/215370.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215370.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215370.html20171125 rutgers email: Please check https://github.com/dengcai78/MatlabFunc  for the most up-to-date codes.

杰哥 2017-11-26 13:10 发表评论
]]>
[zz]MATLAB如何实现十进制数与二q制数的转换http://www.shnenglu.com/guijie/archive/2017/11/08/215336.html杰哥杰哥Wed, 08 Nov 2017 04:49:00 GMThttp://www.shnenglu.com/guijie/archive/2017/11/08/215336.htmlhttp://www.shnenglu.com/guijie/comments/215336.htmlhttp://www.shnenglu.com/guijie/archive/2017/11/08/215336.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215336.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215336.html在MATLAB 中,实现十进制与二进制{化的函数有dec2bin()Qbin2dec()?br />
Reference
http://jingyan.baidu.com/article/59703552c5699a8fc00740d2.html


杰哥 2017-11-08 12:49 发表评论
]]>
matlab dirhttp://www.shnenglu.com/guijie/archive/2017/09/26/215265.html杰哥杰哥Mon, 25 Sep 2017 16:28:00 GMThttp://www.shnenglu.com/guijie/archive/2017/09/26/215265.htmlhttp://www.shnenglu.com/guijie/comments/215265.htmlhttp://www.shnenglu.com/guijie/archive/2017/09/26/215265.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/215265.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/215265.htmlMatlab帮助: list folder contents.
针对根目录,列出所有子文g夹,包括隐藏文g。注意针寚w根目录,q有多出两个文g?."?.."Q分别对应本目录和上一层目录。故TrainDataLoading.m的第八行和第九行如下Q?br />
   templist  = dir(session_dir_name);
   folderlist = templist(3:end); % delete the first two null directory
见本机dir_.m和TrainDataLoading.m?br />用windows菜单Q开始,所有程序,附gQ命令提C符Q输入dir׃列出所有目录,会看到有两个文g?."?.."。cd C:\Q定位到根目录,再dirQ没有两个文件夹"."?.."?br />This is with Nannan and Zhongze's help.

杰哥 2017-09-26 00:28 发表评论
]]>
[zz] Matlab中?p文g的方?/title><link>http://www.shnenglu.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.shnenglu.com/guijie/archive/2016/07/29/214068.html</guid><wfw:comment>http://www.shnenglu.com/guijie/comments/214068.html</wfw:comment><comments>http://www.shnenglu.com/guijie/archive/2016/07/29/214068.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guijie/comments/commentRss/214068.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/guijie/services/trackbacks/214068.html</trackback:ping><description><![CDATA[<div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">首先QP文gZ保护知识产权设计的一U加密文Ӟ是不能查看的?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">q行比较单,和调用m文gҎ一栗?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">下面是一些解释?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文g是对应M文g的一U预解析版本Qpreparsed versionQ。因为当你第一ơ执行M文gӞMatlab需要将其解析(parseQ一ơ(W一ơ执行后的已解析内容会放入内存作W二ơ执行时使用Q即W二ơ执行时无需再解析)Q这无Ş中增加了执行旉。所以我们就预先作解释,那么以后再用该M文gӞ便会直接执行对应的已解析版本Q即P文g。但又因为Matlab的解析速度非常快,一般不用自׃预解析。只有当一些程序要调用到非常多的M文gӞ如GUI应用E序Ӟ才会作预解析Q以增加以后的调用速度?nbsp;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文g可以用来作保密代码之用,如果你给别h一个M文gQ别人可以打开来看C所有的代码和算法?span style="color: red;">如果你的代码不想被别人看刎ͼ那可以给他P文g?/span></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><strong>如何使用.p文g</strong></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">1.首先Q将当前工作目录切换?p文g所在的目录Q然后就可以在左侧的工作I间H口看见该目录所包含的所有文件了Q当然包?p文g啦~</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">2.׃.p文g?m文g的预解析版本Q不能查看、编辑)Q显?p文g?m文g一样都是一个函CQ只不过此时该函数是一个黑盒子|了。D例如test.p文g便意味着存在一个已l编好的函数testQ如何实现我们不知道Q,用这个函数testQ我们需要知道它的参数Ş?此时在命令窗口下键入help testQ即可查看到test函数的参?然后我们可以调用啦</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><strong style="color: red;">如何自己制作.p文g</strong></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">在Matlab中,我们l常把语句或函数写在一个M文g里,便于模块化和代码重用Q比如,写一个test.m的文Ӟ卌定义一个test函数Q:</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% ———————-</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% test.m</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a = 1;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">b = 2;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% ———————-</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">q个M语句文gQ或Q?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% ———————-</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% test2.m</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">function a = test2(b)</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a = b * 2;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% ———————-</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">q个M函数?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">我们在Command Window里输入:</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">>> test</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">x{于输入?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">>> a = 1;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">>> b = 2;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">而输入:</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">>> a = test2(2)</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a =</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">     4</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">便是执行了一个函数?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">以上的内Ҏ惛_部䆾人都知道是怎么一回事了,以下说一说P代码文g?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", 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: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">>> pcode test</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", 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: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">>> test</span></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"><span style="color: red;">其实是运行了test.pQ而不是test.m?/span></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文g是对应M文g的一U预解析版本Qpreparsed versionQ。因为当你第一ơ执行M文gӞMatlab需要将其解析(parseQ一ơ(W一ơ执行后的已解析内容会放入内存作W二ơ执行时使用Q即W二ơ执行时无需再解析)Q这无Ş中增加了执行旉。所以我们就预先作解释,那么以后再用该M文gӞ便会直接执行对应的已解析版本Q即P文g。但又因为Matlab的解析速度非常快,一般不用自׃预解析。只有当一些程序要调用到非常多的M文gӞ如GUI应用E序Ӟ才会作预解析Q以增加以后的调用速度?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">如Matlab的当前目录(Current DirectoryQ有test.m文gQ作预解析后Q又有test.p文g。因为P文g的调用优先比M文g要高Q所以当你调用testӞ会作优先选择而调用了test.p?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">可以修改test.m的代码ؓQ?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% ———————-</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% test.m</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">a = 3;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">b = 4;</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">% ———————-</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">再在Command Window里调用testQ?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">>> test</div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", 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: "Hiragino Sans GB W3", "Hiragino Sans GB", 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: "Hiragino Sans GB W3", "Hiragino Sans GB", 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: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">会出C个WarningQ警告你所调用的P文g比同名的M文g要旧Q即表示M文g已被修改了。尽如此,调用的还是旧的P文gQ即得出a = 1?b = 2?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">P文g可以用来作保密代码之用,如果你给别h一个M文gQ别人可以打开来看C所有的代码和算法。如果你的代码不惌别h看到Q那可以l他P文g?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;">pcode函数也可以应用在M函数文g?/div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; background-color: #ffffff;"></div><div style="line-height: 28px; color: #2e2e2e; font-family: "Hiragino Sans GB W3", "Hiragino Sans GB", 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.shnenglu.com/guijie/aggbug/214068.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guijie/" target="_blank">杰哥</a> 2016-07-29 15:13 <a href="http://www.shnenglu.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)http://www.shnenglu.com/guijie/archive/2015/11/27/212354.html杰哥杰哥Fri, 27 Nov 2015 14:24:00 GMThttp://www.shnenglu.com/guijie/archive/2015/11/27/212354.htmlhttp://www.shnenglu.com/guijie/comments/212354.htmlhttp://www.shnenglu.com/guijie/archive/2015/11/27/212354.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/212354.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/212354.html
XX = XX * randn(size(XX,2),bit);
Y = zeros(size(XX));
Y(XX>=0)=1;
Y = compactbit(Y);


杰哥 2015-11-27 22:24 发表评论
]]>
matlab函数meshgridhttp://www.shnenglu.com/guijie/archive/2015/09/11/211803.html杰哥杰哥Fri, 11 Sep 2015 04:42:00 GMThttp://www.shnenglu.com/guijie/archive/2015/09/11/211803.htmlhttp://www.shnenglu.com/guijie/comments/211803.htmlhttp://www.shnenglu.com/guijie/archive/2015/09/11/211803.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/211803.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/211803.html问题Q?/span>

使用matlab怎么能够产生q样的一l数l呢Q?br />x = 1,2,3,4
y = 5,6

产生一l点Q?/p>

(1,5) (1,6)
(2,5) (2,6)
(3,5) (3,6)
(4,5) (4,6)


{案Q?/span>

x = [1,2,3,4];
y = [5,6];
[X,Y] = meshgrid(x,y);
[X(:), Y(:)]




杰哥 2015-09-11 12:42 发表评论
]]>
matlab函数fminunc:求无U束优化的最优解http://www.shnenglu.com/guijie/archive/2015/08/13/211551.html杰哥杰哥Thu, 13 Aug 2015 04:59:00 GMThttp://www.shnenglu.com/guijie/archive/2015/08/13/211551.htmlhttp://www.shnenglu.com/guijie/comments/211551.htmlhttp://www.shnenglu.com/guijie/archive/2015/08/13/211551.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/211551.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/211551.html

杰哥 2015-08-13 12:59 发表评论
]]>
matlab加? bsxfunhttp://www.shnenglu.com/guijie/archive/2015/08/05/211481.html杰哥杰哥Wed, 05 Aug 2015 03:18:00 GMThttp://www.shnenglu.com/guijie/archive/2015/08/05/211481.htmlhttp://www.shnenglu.com/guijie/comments/211481.htmlhttp://www.shnenglu.com/guijie/archive/2015/08/05/211481.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/211481.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/211481.html训l数据和试数据都去中心?/span>
X = traindata;
label = traingnd;
m = mean(X);
X_zm = bsxfun(@minus, X, m);
traindata_zm = bsxfun(@minus, traindata, m);
testdata_zm = bsxfun(@minus, testdata, m);

matlab函数 bsxfun谈Q{载)
http://blog.sina.com.cn/s/blog_9e67285801010ttn.html

|上关于bsxfun的东西不多,今天需要看C个,׃原博文插入的囄昄不出来,于是W者大发善心进行了contrl+V 以及alt+ctrl+A的操作,供大家交学习?/span>

 

bsxfun是一?/span>matlab自版?/span>R2007a来就提供的一个函敎ͼ作用?/span>”applies an element-by-element binary operation to arrays a and b, with singleton expansion enabled.”

举个例子。假设我们有一列向量和一行向量?/span>

a = randn(3,1), b = randn(1,3) a = -0.2453 -0.2766 -0.1913 b = 0.6062 0.5655 0.9057

我们可以很简单的使用matlab的外?/span>c=a*b来得刎ͼ如图 bsxfun谈Q{载)" o:button="t" target='"_blank"' o:spid="_x0000_i1025">bsxfun谈Q{载)" src="file:///C:\Users\jie\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg">
但如果我们想?/span>外加呢?也就是说把上式求解过E中的乘h做加P

q时我们可以?/span>c=bsxfun(@plus,a,b)来实现?/span>

bsxfun的执行是q样的,如果a?/span>b的大相同,那么c=a+b. 但如果有某维不同Q且a?/span>b必须有一个在q一l的l数?/span>1, 那么bsxfun将的q个虚拟的复制一些来使与多的l数一栗在我们q里Q?/span>b的第一l只?/span>1Q只一行)Q所?/span>bsxfun?/span>b复制3ơŞ成一?/span>3×3的矩阵,同样也将a复制?/span>3×3的矩c这个等价于c=repmat(a,1,3)+repmat(b,3,1)。这?/span>

repmat(a,1,3) ans = -0.2453 -0.2453 -0.2453 -0.2766 -0.2766 -0.2766 -0.1913 -0.1913 -0.1913


repmat
是显式的复制Q当然带来内存的消耗。?/span>bsxfun是虚拟的复制Q实际上通过for来实玎ͼ{效?/span>for(i=1:3),for(j=1:3),c(i,j)=a(i)+b(j);end,end。但bsxfun不会有?/span>matlab?/span>for所带来额外旉。实际验证下q三U方?/span>


>> c = bsxfun(@plus,a,b) c = 0.3609 0.3202 0.6604 0.3296 0.2889 0.6291 0.4149 0.3742 0.7144 >> 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 >> 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


从计时间上来说前两U实现差不多Q远高于for的实现。但如果数据很大Q第二种实现可能会有内存上的问题?/span>所以bsxfun最好?br />

下面看一个更为实际的情况。假设我们有数据A和B, 每行是一个样本,每列是一个特征。我们要计算高斯核,既:





q里@plus是加法的函数数柄Q相应的有减法@minus, 乘法@times, 左右除等Q具体可?doc bsxfun.


 
k(||x-xc||)=exp{- ||x-xc||^2/(2*σ)^2) } 其中xc为核函数中心,σ为函数的宽度参数 , 控制了函数的径向作用范围?/span>


当然可以用双重for实现Q如果第一直觉是用三重for的话…Q?br />

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


使用2,000×1,000大小的A和B, q行旉?8U?/span>
考虑下面向量化后的版本:

sA = (sum(A.^2, 2)); sB = (sum(B.^2, 2)); K2 = exp(bsxfun(@minus,bsxfun(@minus,2*A*B', sA), sB')/beta);


使用同样数据Q运行时间仅0.85U,加速超q?00倍?/span>
如要判断两者结果是不是一P可以如下

assert(all(all(abs(K1-K2)<1e-12)))

 




杰哥 2015-08-05 11:18 发表评论
]]>
matlab函数cathttp://www.shnenglu.com/guijie/archive/2015/07/23/211346.html杰哥杰哥Thu, 23 Jul 2015 00:36:00 GMThttp://www.shnenglu.com/guijie/archive/2015/07/23/211346.htmlhttp://www.shnenglu.com/guijie/comments/211346.htmlhttp://www.shnenglu.com/guijie/archive/2015/07/23/211346.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/211346.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/211346.html{:cat(3,A,B)

杰哥 2015-07-23 08:36 发表评论
]]>
How to solve AX + XB = C for X using matlab?http://www.shnenglu.com/guijie/archive/2015/07/06/211161.html杰哥杰哥Mon, 06 Jul 2015 07:28:00 GMThttp://www.shnenglu.com/guijie/archive/2015/07/06/211161.htmlhttp://www.shnenglu.com/guijie/comments/211161.htmlhttp://www.shnenglu.com/guijie/archive/2015/07/06/211161.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/211161.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/211161.htmlX = sylvester(A,B,C)
http://cn.mathworks.com/help/matlab/ref/sylvester.html

杰哥 2015-07-06 15:28 发表评论
]]>
f-measure matlabhttp://www.shnenglu.com/guijie/archive/2015/06/30/211106.html杰哥杰哥Tue, 30 Jun 2015 13:07:00 GMThttp://www.shnenglu.com/guijie/archive/2015/06/30/211106.htmlhttp://www.shnenglu.com/guijie/comments/211106.htmlhttp://www.shnenglu.com/guijie/archive/2015/06/30/211106.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/211106.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/211106.htmlcat_apcal函数是计MAP的,代码意义很好理解Q比如按距离排序Q前七个只有1???是和query相同的类Q则MAP=(1+2/3+3/5+4/7)/4 (This is with discussing with Shu Zhang). 但Deep hashing for compact (CVPR 2015) mean average
precision (mAP): which computes the area under the precision-recall curve.
matlab曲线下如何求面积?
如果知道函数表达式的话,调用quad函数可以了。如果不知道函数表达式只知道q一pdL点,x和yQ则trapz(x,y)卛_
?Q本机Hashing\code\ITQ\delete\test_cifar_PCA_ITQ_V01.mQ对d的precison和recall曲线Q计曲U下的面U,用trapz(recall,precision)卛_
Shu Zhang说不知以上两U是否等P如果按照Deep hashing for compact (CVPR 2015)面U,则直接就能看Z同的Ҏ谁的MAP大,因ؓ谁的曲线在上方就谁大

w䆾证照片和真h的比Ҏ两个指标
误识率:他明明不是张三,但你错误地把他判断成了张三。误识率1%Q意味着?00个h来冒充其他hQ有1个h会冒充成功。应该就是FAR
识别率:张三?0%左右的概率被pȝ说你不是张三Q识别率90%。应该就?-FRR
二代证比真hQ识别率90% (误识?%)
即?%的认假率的情况下Q识别率目前可能大概做到90%左右。当然这个前提条件是_我们用的是二代证卡内的那张低质量Q压~得非常狠,照片的分辨率不够高的那张照片。如果我们用的是一张清晰的Q近期的证g照,那么q个l论可以做到大概Q误识率可以做到万分之一的情况下Q识别率可以做到90%以上的正率?/div>
ReferenceQ?/div>
造就Talk | ׃光:天眼pȝl将开启,你准备好了吗Qhttp://mp.weixin.qq.com/s?__biz=MzAwNTcyNDU5MQ==&mid=509662068&idx=1&sn=f14840fb7927497ad0d49e1d18eb6b5a&scene=1&srcid=0529xR8z0qC240GLkQZuUAG9&from=groupmessage&isappinstalled=0#wechat_redirect 已看两次

http://www.mathworks.com/matlabcentral/fileexchange/37758-performance-measures-for-classification/content/Evaluate.m

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];


杰哥 2015-06-30 21:07 发表评论
]]>The matlab code of canonical correlation analysis (CCA)http://www.shnenglu.com/guijie/archive/2015/06/02/210807.html杰哥杰哥Tue, 02 Jun 2015 14:10:00 GMThttp://www.shnenglu.com/guijie/archive/2015/06/02/210807.htmlhttp://www.shnenglu.com/guijie/comments/210807.htmlhttp://www.shnenglu.com/guijie/archive/2015/06/02/210807.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/210807.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/210807.html%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

function [Wx, r] = cca(X,Y,reg)

%
% X is input data for the 1st view (image), n*d, n images, d dim
% Y is input data for the 2nd view (Tag), n*D, D dim
% reg is regularization parameter, usually set by validation
% in our work, reg = 0.0001 which works well
%
% Wx is the embedding function for image
% r is the eigenvalue
%
%
% to run the code, you need visual data X and tag data Y
%
% bit = 32, 64, 128 ...
% [eigenvector,r] = cca(X, Y, 0.0001); % this computes CCA projections
% eigenvector = eigenvector(:,1:bit)*diag(r(1:bit)); % this performs a scaling using eigenvalues
% E = X*eigenvector; % final projection to obtain embedding E
%


z = [X, Y];
C = cov(z);
sx = size(X,2);
sy = size(Y,2);
Cxx = C(1:sx, 1:sx) + reg*eye(sx);
Cxy = C(1:sx, sx+1:sx+sy);
Cyx = Cxy';
Cyy = C(sx+1:sx+sy,sx+1:sx+sy) + reg*eye(sy);


Rx = chol(Cxx);
invRx = inv(Rx);
Z = invRx'*Cxy*(Cyy\Cyx)*invRx;
Z = 0.5*(Z' + Z); 


[Wx,r] = eig(Z);   % basis in h (X)
r = sqrt(real(r)); % as the original r we get is lamda^2
Wx = invRx * Wx;   % actual Wx values
r = diag(r);

[r index] = sort(r,'descend');
Wx = Wx(:,index);

 
Other references:

Information Fusion 2017 Multi-view learning overview的公??
Section 2.1 of "NCA 2013 A survey of multi-view machine learning"

 




杰哥 2015-06-02 22:10 发表评论
]]>
[zz]matlab囑փ滤Lhttp://www.shnenglu.com/guijie/archive/2015/05/11/210619.html杰哥杰哥Mon, 11 May 2015 12:33:00 GMThttp://www.shnenglu.com/guijie/archive/2015/05/11/210619.htmlhttp://www.shnenglu.com/guijie/comments/210619.htmlhttp://www.shnenglu.com/guijie/archive/2015/05/11/210619.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/210619.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/210619.htmlclear;
I=imread('a.jpg');             %d囑փ
K1=medfilt2(I,[10 10]);          %中值o?br />h1=ones(5,5)/25;
K2=imfilter(K1,h1);       %均值o?br />figure, imshow(K2), title('滤L后的囑փ')

杰哥 2015-05-11 20:33 发表评论
]]>
The matlab code to normalize each feature of training data and test data to unit mean and zero variancehttp://www.shnenglu.com/guijie/archive/2014/12/05/209030.html杰哥杰哥Fri, 05 Dec 2014 04:32:00 GMThttp://www.shnenglu.com/guijie/archive/2014/12/05/209030.htmlhttp://www.shnenglu.com/guijie/comments/209030.htmlhttp://www.shnenglu.com/guijie/archive/2014/12/05/209030.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/209030.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/209030.html    fea_Train = fea(:,trainIdx);
    gnd_Train = gnd(trainIdx);
    fea_Test = fea(:,testIdx);
    gnd_Test = gnd(testIdx);
    train_size = length(gnd_Train);
    test_size  = length(gnd_Test);
   
    %%%%%%%%%%%%%%%%%%%%%%%Normalization begins%%%%%%%%%%%%%%%%%%%%%%%
    train_data_std = std(fea_Train');
    train_data_mean = mean(fea_Train');
    train_data_std_matrix = ones(train_size,dim)*diag(train_data_std);
    train_data_std_matrix(train_data_std_matrix==0)=1;
    train_data_mean_matrix = ones(train_size,dim)*diag(train_data_mean);
    train_scale_data = (fea_Train' - train_data_mean_matrix)./train_data_std_matrix;
    clear train_data_mean_matrix train_data_std_matrix;
    fea_Train = train_scale_data';
    clear train_scale_data;
   
    test_data_std_matrix = ones(test_size,dim)*diag(train_data_std);
    test_data_mean_matrix = ones(test_size,dim)*diag(train_data_mean);
    clear train_data_mean train_data_std;
    test_data = (fea_Test' - test_data_mean_matrix)./test_data_std_matrix;
    clear test_data_std_matrix test_data_mean_matrix;
    fea_Test = test_data';
    clear test_data;
    %%%%%%%%%%%%%%%%%%%%%%%Normalization ends%%%%%%%%%%%%%%%%%%%%%%%

杰哥 2014-12-05 12:32 发表评论
]]>
怎么安装*.jar文gQ?/title><link>http://www.shnenglu.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.shnenglu.com/guijie/archive/2014/07/14/207643.html</guid><wfw:comment>http://www.shnenglu.com/guijie/comments/207643.html</wfw:comment><comments>http://www.shnenglu.com/guijie/archive/2014/07/14/207643.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guijie/comments/commentRss/207643.html</wfw:commentRss><trackback:ping>http://www.shnenglu.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'">Q运行会提示Q错误:</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'">q个软g包是</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'">文gQ原以ؓ解压p扑ֈ安装文gQ但没有?/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'">软g?/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'">软g安装q程如下</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'">W一?/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'">Q安?/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">“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'">Qƈ配置环境变量Q计机</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">-></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'">高pȝ讄</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">->环境变量<span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">-></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">->Path(如果没有PATHQ新Z个变量PATH卛_)-></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">”; C:\Program Files (x86)\Java\jre1.6.0_02\bin”?#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'">Q?/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"> </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'">W二?/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'">Q安?/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'">Q?/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'">q行<span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">cmd-></font></span>E:(定位到E?;</span><span style="mso-bidi-font-size: 10.5pt" lang="EN-US"><font face="Times New Roman">cmd->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'">目的Q定位到</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">) ->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'">在安装过E中会有提示Q?/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">   </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">   </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">       </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">   </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">   </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">       </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">       </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'">Q?/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'">步代表啥含义Q没这一步?/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"> </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'">W三?/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'">Q将</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">”curPath = pwd;”(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">帮助卛_Q就是当前目?/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'">E序的最开始加上加?/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'">Q这样就不会出现如下错了Q?/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"> </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'">已经按照上述步骤Q在我台式机成功安装</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'">软g</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'">软g</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.shnenglu.com/guijie/aggbug/207643.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guijie/" target="_blank">杰哥</a> 2014-07-14 15:47 <a href="http://www.shnenglu.com/guijie/archive/2014/07/14/207643.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]Matlab囑Ş中显C数学公?/title><link>http://www.shnenglu.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.shnenglu.com/guijie/archive/2013/11/02/204063.html</guid><wfw:comment>http://www.shnenglu.com/guijie/comments/204063.html</wfw:comment><comments>http://www.shnenglu.com/guijie/archive/2013/11/02/204063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guijie/comments/commentRss/204063.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/guijie/services/trackbacks/204063.html</trackback:ping><description><![CDATA[<div><a >http://blog.sina.com.cn/s/blog_401aa0540100ufl1.html</a><br /><br />Matlab l图Ӟ 可以通过 讄 "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}^f(x)dx$', 'interpreter','latex');<br /><br /><span style="color: red">?Q?/span>我的E序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">?Q?/span>我的E序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中的xlabelQylabelQlegend和text函数中用latex(<span style="color: red">以下关于legend的不必看Q已到我的例?/span>)---------------------------<br />http://blog.sina.com.cn/s/blog_6e0693f70100nj22.html<br />以下例子中展CZ如何用在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> 'String','$$\int_0^x\!\int_y dF(u,v)$$',...</div> <div> 'Position',[3 1],...</div> <div> '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.shnenglu.com/guijie/aggbug/204063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guijie/" target="_blank">杰哥</a> 2013-11-02 20:00 <a href="http://www.shnenglu.com/guijie/archive/2013/11/02/204063.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>元胞(cell)与结构体(struct)http://www.shnenglu.com/guijie/archive/2013/09/21/203326.html杰哥杰哥Sat, 21 Sep 2013 03:31:00 GMThttp://www.shnenglu.com/guijie/archive/2013/09/21/203326.htmlhttp://www.shnenglu.com/guijie/comments/203326.htmlhttp://www.shnenglu.com/guijie/archive/2013/09/21/203326.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/203326.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/203326.html元胞数组cell array
Element:cell;以下标index讉KcellQ以元胞内编址content addressing讉K元胞内容Qcell中可以存放Q何类型,M大小的数l?/div>
cell的创?/span>
cell()%创徏元胞数组
c=cell(2);%创徏2×2?/div>
c=cell(m,n);%创徏m×n?用cell函数创徏元胞数组Q创建的数组为空元胞?span style="color: red">cell函数创徏I元胞数l的主要目的是ؓ数组预先分配q箋的存储空_节约内存占用Q提高执行效率。同cppblog/MATLABE序的优化、预先分配存储空?/span>
c_str=char('This is cell array');c_R=rand(3,3);c_comp=1+2i;c_sym=sym('sin(-3*t)*exp(-t)');
两种赋值方式:index赋值和content addressing赋?/span>
index赋|A(1,1)={c_str};A(1,2)={c_R};A(2,1)={c_comp};A(2,2)={c_sym};
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.

cell array的访?br />B{1,2}
B{1,2}(1,2)

问题Q?/span>我有一个cell变量。比方说3*1的size  每一个里面存了一??的矩cmatlab中有没有快速的语句把每一?*9的矩阵,reshape?*3的矩c也是说对一个cell变量中的每一个元?应该是一个矩?q行reshape操作。当然不想用循环做?br />{案Q?/span>A = {rand(1,9),rand(1,9),rand(1,9)}; cellfun(@(x) reshape(x, 3, 3).', A, 'UniformOutput', false) 

cell转化成矩늚函数cell2mat
例:A = {rand(1,9),rand(1,9),rand(1,9)};cell2mat(A)
l构体数l?structure array
Element:structure
域访?/div>
域中可以存放Mcd、Q何大的数组
cC
cell和struct的{换cell2struct.

Matlab提供了两U定义结构的方式Q直接应用和使用struct函数?/span>
1. 使用直接引用方式定义l构
与徏立数值型数组一P建立新struct对象不需要事先申明,可以直接引用Q而且可以动态扩充。比如徏立一个复数变量xQ?br />x.real = 0; % 创徏字段名ؓrealQƈ字段赋gؓ0
x.imag = 0 % 为x创徏一个新的字DimagQƈ字段赋gؓ0
x =
real: 0
imag: 0
然后可以旗动态扩充ؓ数组Q?br />x(2).real = 0; % x扩充?×2的结构数l?br />x(2).imag = 0;
在Q何需要的时候,也可以ؓ数组动态扩充字D,如增加字DscaleQ?br />x(1).scale = 0;
q样Q所有x都增加了一个scale字段Q而x(1)之外的其他变量的scale字段为空Q?br />x(1) % 查看l构数组的第一个元素的各个字段的内?
ans =
real: 0
imag: 0
scale: 0
2. 使用struct函数创徏l构
使用struct函数也可以创建结构,该函C生或吧其他Ş式的数据转换为结构数l?br />struct的用格式ؓQ?br />s = sturct('field1',values1,'field2',values2,…);
该函数将生成一个具有指定字D名和相应数据的l构数组Q其包含的数据values1、valuese2{必Mؓh相同l数的数据,数据的存放位|域其他l构位置一一对应的。对于struct的赋值用C元胞数组。数lvalues1、values2{可以是元胞数组、标量元胞单元或者单个数倹{每个values的数据被赋值给相应的field字段?br />当valuesx为元胞数l的时候,生成的结构数l的l数与元胞数l的l数相同。而在数据中不包含元胞的时候,得到的结构数l的l数?×1的。例如:
s = struct('type',{'big','little'},'color',{'blue','red'},'x',{3,4})
s =
1x2 struct array with fields:
type
color
x

参考文献:http://blog.sciencenet.cn/blog-436588-320694.html


杰哥 2013-09-21 11:31 发表评论
]]>matlab fscanfhttp://www.shnenglu.com/guijie/archive/2013/09/13/203214.html杰哥杰哥Fri, 13 Sep 2013 06:34:00 GMThttp://www.shnenglu.com/guijie/archive/2013/09/13/203214.htmlhttp://www.shnenglu.com/guijie/comments/203214.htmlhttp://www.shnenglu.com/guijie/archive/2013/09/13/203214.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/203214.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/203214.htmll合我的教材P31
matlab文g操作Q见电脑目录Blessing of Dimensionality\Features\code\readFea.m ?findImsFeaIdx.m
http://blog.sina.com.cn/s/blog_4cfb5a6201015i8q.html

?Q?br />路径+文g名:d:\moon.txt
内容Q?br />
13,1,3.4
3,2.1,23
1,12,2
4,5.4,6
现在Zdmoon中的数据存在一个数l里Q可以用如下Ҏ

fid=fopen('d:\moon.txt');

data=fscanf(fid,'%f,%f,%f',[3,inf]) ;%q里得用单引?/span>

fclose(fid);

q时data中的数据如下Q?/span>
13 3 1 4
1 2.1 12 5.4
3.4 23 2 6

?Q?br />数据在d:\test.txt
0.00    good 2
0.10    bot 3
1.02    yes 4
1.00    yes 5
1.00    yes 6
1.00    yes 3
1.00    yes 5
1.00    yes 6
1.00    yes 1
1.00    yes 3
1.00    yes 7
1.00    yes 3
1.00    yes 2

E序Q?/span>
fid = fopen('d:\test.txt', 'r');
a = fscanf(fid, '%f    %*s %d ', [2 inf])    % It has two rows now.
fclose(fid);
a
解释?/span>Q第一列和W二列之间有四个I格Q?span style="color: red;">format也要四空格哦Q有三列即三U类型,要有三种formatQ?span style="color: red;">%*s即ؓ不输出字W串型?br />

fid = fopen('E:\temp\test.txt', 'r');
a = fscanf(fid, '%f    %*s %*f ', 5)    % It has five rows and one column now. %*s %*f 卌两个不输?/span>
fclose(fid);
a

E序l果为:
a =
         0
    0.1000
    1.0200
    1.0000
    1.0000


杰哥 2013-09-13 14:34 发表评论
]]>
matlab中对角阵的存储,diag vs spdiagshttp://www.shnenglu.com/guijie/archive/2013/07/07/201586.html杰哥杰哥Sun, 07 Jul 2013 03:39:00 GMThttp://www.shnenglu.com/guijie/archive/2013/07/07/201586.htmlhttp://www.shnenglu.com/guijie/comments/201586.htmlhttp://www.shnenglu.com/guijie/archive/2013/07/07/201586.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/201586.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/201586.htmlFeiping Nie的NIPS 2010公布代码L21R21W?4行用?/span>D = spdiags(d,0,n,n);可用D =diag(d)实现cM功能Q但可能效率更低Q在54服务器FRGC 30TrainQ前者耗时22U,后者耗时53U。因为前者采用稀疏存储,更节省内存。Nie老师Ԍ功能相同Q但׃是sparse的矩阵,矩阵很大时会快很多?/span>
单例子:
p=[1 2 3]; D1=diag(p);D2 =  spdiags(p',0,3,3);


杰哥 2013-07-07 11:39 发表评论
]]>matlab高效实现矩阵乘以对角?/title><link>http://www.shnenglu.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.shnenglu.com/guijie/archive/2013/07/04/201514.html</guid><wfw:comment>http://www.shnenglu.com/guijie/comments/201514.html</wfw:comment><comments>http://www.shnenglu.com/guijie/archive/2013/07/04/201514.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guijie/comments/commentRss/201514.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/guijie/services/trackbacks/201514.html</trackback:ping><description><![CDATA[<div>[dim,num]=size(Data);weight是一?×num的行向量Q够成一个对角阵P=diag(weight);目标Q实现Data*P<br /><span style="color: red;">方式一</span>QData*diag(weight)Q这U需要dim×num×(2num-1)个加法或乘法Q?br /><span style="color: red;">方式?/span>QData.*repmat(weight,dim,1)Q这U只需要dim×num个乘法?br />q就是Ran He的CVPR 12代码CRFSW?1行用:X1 = Data.*repmat(weight,dim,1)实现Data*P的原因?/div><img src ="http://www.shnenglu.com/guijie/aggbug/201514.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guijie/" target="_blank">杰哥</a> 2013-07-04 14:28 <a href="http://www.shnenglu.com/guijie/archive/2013/07/04/201514.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>能不用inv量不用http://www.shnenglu.com/guijie/archive/2013/07/03/201500.html杰哥杰哥Wed, 03 Jul 2013 14:47:00 GMThttp://www.shnenglu.com/guijie/archive/2013/07/03/201500.htmlhttp://www.shnenglu.com/guijie/comments/201500.htmlhttp://www.shnenglu.com/guijie/archive/2013/07/03/201500.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/201500.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/201500.html实现一个矩늚逆乘以另外一个矩阵,也用右除。类似实C个矩阵乘以另外一个矩늚逆,用左除,不用inv

http://zhidao.baidu.com/question/308277515.html
左除要不要求矩阵可逆?Z么一个不可逆的矩阵a在matlaB中用invQaQ?y不可计算Q用a\y可以计了Q?/div>
{:左除不要求矩阵可逆,在matlab中invQaQ?y与a\yq不{同Q左除命令有更深的内涵,当a为方阵且可逆时Q二者都能得到正结果,?span style="color: red;">左除_ֺ更高Q运数度快(我实验下来,实是这?Q特别当A为病态矩阉|Qinv(A)*y的计结果不可靠Q不q这U矩阵出现的概率很低Q,但用左除计算出的l果却很可靠Q因为左除是matlab设计的一个智能算W,他可以智能地选择法Q当方程为矛盾方E(也就是独立方E个数多余未知数个数Q时Q此时显然没有精解Q但很多时候我们需要x在最二乘意义下的解Q此时用A\yp得到x的最二乘解?br />
Haiqing Li说他从来不看q些中文的,有些人可能回{得不专业或误解Q到matlab帮助搜烦arithmetic operators有左除或者右除详l解?br />
试例子Q?br />W一个matlab的m文g
% 生成数据
rand('state',0);
n = 10000;% 也可讄?000
A = randn(n,n);
B = randn(n,1);
save MyFile1 A B;

W二个matlab的m文g
% 试求逆时?/div>
tic;
load MyFile1;
n = size(A,1);
C1 = inv(A'*A+0.01*eye(n))*B;
save MyFile2 C1;
toc;

W三个matlab的m文g
% 试左除旉
tic;
load MyFile1;
n = size(A,1);
C2 = (A'*A+0.01*eye(n))\B;
save MyFile3 C2;
toc;


杰哥 2013-07-03 22:47 发表评论
]]>如何用matlab求矩늚最大奇异|(Matlab code to solve the largest singular value of a matrix)http://www.shnenglu.com/guijie/archive/2013/05/03/199950.html杰哥杰哥Fri, 03 May 2013 13:44:00 GMThttp://www.shnenglu.com/guijie/archive/2013/05/03/199950.htmlhttp://www.shnenglu.com/guijie/comments/199950.htmlhttp://www.shnenglu.com/guijie/archive/2013/05/03/199950.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/199950.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/199950.htmln = norm(A) returns the largest singular value of A, max(svd(A)).


杰哥 2013-05-03 21:44 发表评论
]]>combntns函数所引v的内存不问?/title><link>http://www.shnenglu.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.shnenglu.com/guijie/archive/2012/12/13/196200.html</guid><wfw:comment>http://www.shnenglu.com/guijie/comments/196200.html</wfw:comment><comments>http://www.shnenglu.com/guijie/archive/2012/12/13/196200.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guijie/comments/commentRss/196200.html</wfw:commentRss><trackback:ping>http://www.shnenglu.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函数所引v的内存不I到网上搜索有人提问,但没有解x案?br /><span style="color: red;">问题</span>Q我惛_一个序列的Ll合Q用combntnsQ在数目较小Ӟ可以辑ֈ目的Q但是数目变大时Q就不行了,求助各位?/p><p style="font-family: 宋体; line-height: 21.33333396911621px; background-color: #ffffff;">例如?:5,里面3个数字的l合Q很Ҏ得到?br />combntns(1:5,3) 可以了</p><p style="font-family: 宋体; line-height: 21.33333396911621px; background-color: #ffffff;">但是?:100里面10个数字的l合Q就不行了?br /><span style="color: red;">我的解决ҎQ?/span><span style="color: #000000;">如果你未必要取所有组合,可以?Q?00中Q?0个数Q再取这20个数字里?0个数字的l合?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.shnenglu.com/guijie/aggbug/196200.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guijie/" target="_blank">杰哥</a> 2012-12-13 08:30 <a href="http://www.shnenglu.com/guijie/archive/2012/12/13/196200.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>win7下matlab7.0的卸载问?Z么matlab2010a只能在断|时才能打开Q?/title><link>http://www.shnenglu.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.shnenglu.com/guijie/archive/2012/12/05/196015.html</guid><wfw:comment>http://www.shnenglu.com/guijie/comments/196015.html</wfw:comment><comments>http://www.shnenglu.com/guijie/archive/2012/12/05/196015.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guijie/comments/commentRss/196015.html</wfw:commentRss><trackback:ping>http://www.shnenglu.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>在win7Q?2位家庭版?有两U方法解x常运行问题,一是将配色Ҏ改ؓl典(在桌面空白处叛_鼠标Q选择个性化Q在弹出的对话框中选择windowsl典主题卛_)Q二是兼Ҏ改为vista sp1或sp2.<span style="background-color: #ffffff; color: #444444; font-family: Tahoma, 'Microsoft Yahei', Simsun;">卸蝲完了后,再把主题改回C原来的主题?br /><br /></span><div><span style="color: red;">Z么matlab2010a只能在断|时才能打开Q?/span><br />20121207发现matlab打不开Q上|搜索解x案。有断网可以。我实验两次Q注销后断|能打开matlabQ注销后连|,不打开其他ME序Qmatlabq是打不开Q等了五分钟。能看到matlabq程。l搜?#8220;Windows 7 matlab断网才能打开”。查到解x?http://wenwen.soso.com/z/q294348187.htm)Q?span style="font-family: Arial, Helvetica, sans-serif, SimSun; line-height: 22px;">你可能用的是window7吧,q种现象的生是׃MatLab与Windows 7 的兼Ҏ问题,解决的方法如下:从纯净的Windows XPpȝ中system32目录中拷贝一份iphlpapi.dll?Matlab 2010a安装目录\bin\win32中问题即可解冻I当然QX64的系l要?Windows XP X64 中去拗我问Lianyang Ma要了q个文gQ重启下电脑搞好了(即在同时打开qq,gtalk,h览?</span>FileZilla的情况下Q也能打开matlab<span style="font-family: Arial, Helvetica, sans-serif, SimSun; line-height: 22px;">)?   ?/span>配色Ҏ和兼Ҏ没有关pR?/div></div><img src ="http://www.shnenglu.com/guijie/aggbug/196015.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guijie/" target="_blank">杰哥</a> 2012-12-05 19:32 <a href="http://www.shnenglu.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?http://www.shnenglu.com/guijie/archive/2012/11/21/195475.html杰哥杰哥Wed, 21 Nov 2012 10:31:00 GMThttp://www.shnenglu.com/guijie/archive/2012/11/21/195475.htmlhttp://www.shnenglu.com/guijie/comments/195475.htmlhttp://www.shnenglu.com/guijie/archive/2012/11/21/195475.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/195475.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/195475.html

杰哥 2012-11-21 18:31 发表评论
]]>
How to compile the mexfile?http://www.shnenglu.com/guijie/archive/2012/10/18/193450.html杰哥杰哥Thu, 18 Oct 2012 00:27:00 GMThttp://www.shnenglu.com/guijie/archive/2012/10/18/193450.htmlhttp://www.shnenglu.com/guijie/comments/193450.htmlhttp://www.shnenglu.com/guijie/archive/2012/10/18/193450.html#Feedback0http://www.shnenglu.com/guijie/comments/commentRss/193450.htmlhttp://www.shnenglu.com/guijie/services/trackbacks/193450.htmlAn Efficient Projection for l1,∞ Regularization该文提供代码Q在Readme文g中说To run the projection in Matlab, you first need to compile the mexfile:
$ mex -output projL1Inf mex-projL1Inf.c 
Then, from Matlab, test the projection by running the script "runprojection", 

(1)在我W记本电脑,打开matlabQ打开该程序所在的文g夹,在matlab命o行输入mex -setupQ?span style="color: red">matlab输出Q?/span>Would you like mex to locate installed compilers [y]/n? 手动输入Q?/span>y Q?span style="color: red">matlab输出Q?nbsp;
Select a compiler:  手动输入Q?, matlab输出Q?/span> Are these correct [y]/n?   手动输入Q?/span>y ?span style="color: #ff0000">手动输入Q?/span> mex -output projL1Inf mex-projL1Inf.c Q可能是因ؓ我的W记本电脑没装VCQ有错误。在我本能运行,关键是生成projL1Inf.mexw32q个文g可以了Q在Mingming Gong电脑上生成,拯到我的电脑就可以了?/span> Mingming电脑装VC了,但还是不能编译,他讲可能原因是这个c语言代码本来是在linux下写的,在windows上跑不了Qnaiyang也这么说?span style="color: red">20121023, after Mingming Gong saw my blog, he found the solution to produce the file projL1Inf.mexw32. 只要mex-projL1Inf.c后缀改ؓmex-projL1Inf.cppQprojL1Inf.c后缀改ؓprojL1Inf.cppQmex-projL1Inf.cppW?9行改?include "projL1Inf.cpp"Q只要修改这三点可以在windows下编译,我已l从他那里拷贝了projL1Inf.mexw32 。从我本是不能编译,因ؓ本机没装VC?span style="color: #ff0000">?/span>因:*.cpp是支持C和C++的;*.c只支持CQ故//不支持。在Linux下C?/span>C++是两个编译器(在linux下c是用gcc~译QC++使用g++~译)Q在windows下,C和C++是可以同时用VC~译的?br />
20130629在NLPR?4服务器用mex -output projL1Inf mex-projL1Inf.cpp成功~译生成文gprojL1Inf.mexw64Q不知ؓ什么用mex -setup一步一步来不行?br />
(2)在uts clusterQ按照上面输入的命oQ有错误和警?(Mingming said that the warning does not matter)
Warning: You are using gcc version "4.4.6".  The version
         currently supported with MEX is "4.3.4". 
错误QprojL1Inf.c:248: error: expected expression before '/' token
projL1Inf.c:250: error: expected expression before '/' token
projL1Inf.c:252: error: expected expression before '/' token
打开projL1Inf.c Q将q三行的注释//Q均换成/* * / 
q样的作用,是生成projL1Inf.mexa64q个文g.如果用命令mex mex-projL1Inf.c,是生成mex-projL1Inf.mexa64 (已经实践Q?/span>原?/span> projL1Inf.mexa64 删除Q用命omex mex-projL1Inf.c,是生成mex-projL1Inf.mexa64Q?/span> 再将q个文g改名为projL1Inf.mexa64Q再q行runprojection q是可以?

20121208在uts服务器编译libsvm-mat-2.9-1Q编译有问题Q根据提C,所有文?.c都变?.cpp,q有问题g++: svm.obj: No such file or directoryQ上|搜索解x案http://blog.csdn.net/kit_147/article/details/7417734Q将文gsvm.obj改ؓsvm.oQ编译就没有问题了,但用E序试q有问题Q提C?"-largeArrayDims"的问题,make.m开始注释:% add -largeArrayDims on 64-bit machinesQ问mingming gong怎么addQ将makefile中的mex...修改为mex...-largeArrayDims卛_。例?br />
mex -O -c svm.cpp 
mex -O -c svm_model_matlab.c 
修改?/span>
mex -O -c svm.cpp -largeArrayDims
mex -O -c svm_model_matlab.c -largeArrayDims
(This is with Mingming Gong's help)

20150710在跑FastHash提示错误QbinaryTreeTrain1.mexw64不是有效的w32应用E序,感到费解Q这?4位机Q怎么会提C个错误。Jian Liang讲重新编译下p了,他就在matlabH口敲入mex binaryTreeTrain1.cppQ再敲入mex forestInds.cpp可以了


杰哥 2012-10-18 08:27 发表评论
]]>
þþWWW˳ɾƷ| þwww˳_Ƭ| ҹƷþþþþž| ˾þۺij| ŷ˾þƬ| þ޹ƷAVϼ| 칫ҾþþƷ| ƷþþӰ| ɫþþþþþС˵| þþþùһëƬ| þŮƷƷ| ھƷþù| ƬҹƬþ| 91ƷѾþþþþþþ| Ʒ99þþƷ| ޹Ʒþ98| ޹Ʒ˾þ| ھƷþþþþ鶹| 996þùƷ߹ۿ| þۺϾƷ| 99REþþƷﶼǾƷ| þü¶| 99þùۺϾƷԭ| ¾þþþa| ޹ƷþSM| ޾Ʒþǧն| þùɫavѿ| þAV뾫Ʒɫҹ鶹| ɫͷվþ| þþþþ޾ƷӰԺ| ģ˽ĹƷþ| ĻۺϾþò| Ҫþðѹۿ| þóСƵ| þþ| ĻþþƷAPP | ޾Ʒ99þ| Ʒþþþþþ| ŷƷһƷþ| 99þó18վ| ޳˾þ|