Thursday, 22 March 2012
合并两个数组
b1 = data(1:10,4); %b1来自第四列的第一到第十个元素
b2 = data(11:20,4); %b2来自第四列的第十一到第二十个元素
b12 = [b1;b2]; %合并b1,b2到b12中
b1 = data(1:10,4); %b1来自第四列的第一到第十个元素
b2 = data(11:20,4); %b2来自第四列的第十一到第二十个元素
b12 = [b1;b2]; %合并b1,b2到b12中
Wednesday, 7 March 2012
两组数据,不同颜色,现实在plot图中
x1 = data(1:21,2);
t1 = data(1:21,4);
x2 = data(22:40,2);
t2 = data(22:40,4);
plot(x1,t1,'.b',x2,t2,'.r');
%x轴 y轴
xlabel('# Words');
ylabel('# Topics');
添加图标
legend('arm','topic-arm'); %分别将字符串1、字符串2…标注到图中,每个字符串对应的图标为画图时的图标。
x1 = data(1:21,2);
t1 = data(1:21,4);
x2 = data(22:40,2);
t2 = data(22:40,4);
plot(x1,t1,'.b',x2,t2,'.r');
%x轴 y轴
xlabel('# Words');
ylabel('# Topics');
添加图标
legend('arm','topic-arm'); %分别将字符串1、字符串2…标注到图中,每个字符串对应的图标为画图时的图标。
Tuesday, 6 March 2012
boxplot
%导入数据,默认存入data矩阵
a1 = data(1:21,4); %第四列的第1行到第21行存入到列向量a1中
a2 = data(22:40,4); %第四列的第22行到第40行存入到列向量a2中
a2 = [a2' [NaN,NaN]]' %因为a2比a1少两个,所以用NaN填充
A = [a1,a2]; %构造矩阵
boxplot(A,'labels',{'ARM','ARM-TOPIC'}); %画图 boxplot
boxplot图画出最小值,1/4位置值,median, 3/4位置值和最大值
%导入数据,默认存入data矩阵
a1 = data(1:21,4); %第四列的第1行到第21行存入到列向量a1中
a2 = data(22:40,4); %第四列的第22行到第40行存入到列向量a2中
a2 = [a2' [NaN,NaN]]' %因为a2比a1少两个,所以用NaN填充
A = [a1,a2]; %构造矩阵
boxplot(A,'labels',{'ARM','ARM-TOPIC'}); %画图 boxplot
boxplot图画出最小值,1/4位置值,median, 3/4位置值和最大值
Friday, 24 February 2012
Mac Vim free mind
多个拷贝
拷贝到寄存器中
1 选中要拷贝的内容
2 "[名字]y
粘贴的时候
"[名字]p
输入提示
Ctrl+p,Ctrl+n
命令模式下的
hjkl 移动
v 切换到visual模式
查找
/....
高亮显示查找内容
set hlsearch
拷贝到寄存器中
1 选中要拷贝的内容
2 "[名字]y
粘贴的时候
"[名字]p
输入提示
Ctrl+p,Ctrl+n
命令模式下的
hjkl 移动
v 切换到visual模式
查找
/....
高亮显示查找内容
set hlsearch
Tuesday, 31 January 2012
Matlab draw plot graph closed automatically
Matlab 7.4
Mac 10.6
Problem:
When I use Matlab to draw graphs, like hist(x,y), scatter(x,x), the matlab will close automatically
Solution:
http://www.mathworks.com/matlabcentral/answers/11086-matlab-closing-automatically-when-plotting-data-or-opening-an-existing-saved-figure
Mac 10.6
Problem:
When I use Matlab to draw graphs, like hist(x,y), scatter(x,x), the matlab will close automatically
Solution:
http://www.mathworks.com/matlabcentral/answers/11086-matlab-closing-automatically-when-plotting-data-or-opening-an-existing-saved-figure
There is an incompatibility in a recent Java update (1.6.0_26) affecting MATLAB versions R2007a, R2007b and R2008a, that can be worked around by following these steps:
1. Close MATLAB, if it is running.
2. In Terminal or xterm , type:
open -a TextEdit /Applications/MATLAB_R2008a/bin/.matlab7rc.sh
In the path above, change "/Applications/MATLAB_R2008a/bin/" accordingly depending on your version of MATLAB's root folder name.
3. In the editor, navigate to Line 410 to locate:
DYLD_LIBRARY_PATH=
This line is a part of the following code in the "mac" section of matlab7rc.sh:
if [ "$DYLD_LIBRARY_PATH" != "" ]; then DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH else DYLD_LIBRARY_PATH= fi
4. Change the line from
DYLD_LIBRARY_PATH
to
DYLD_LIBRARY_PATH=/System/Library/Frameworks/JavaVM.framework/Libraries
For users on MATLAB R2007a and R2007b, after making the change in the "mac" section, make the same change the "maci" section (right below the "mac" section).
5. Save the changes (Command-S).
6. Restart MATLAB.
Sunday, 29 January 2012
setup MacVim
Initial
cd ~/ //进入到用户根目录
vim .gvimrc //创建并且编辑该文件
重新启动macvim
cd ~/ //进入到用户根目录
vim .gvimrc //创建并且编辑该文件
重新启动macvim
Subscribe to:
Posts (Atom)