上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 48 下一页
摘要: 矩阵最大值和对应的行列号 找最大元素就是max(max(A)),注意二维矩阵要写两个max 找对应位置用find函数 举个例子: >> A=[1 2 3 ;4 5 6] A = 1 2 3 4 5 6 >> max(max(A)) ans = 6 >> [x y]=find(A==max(max(A))) x = 2 y = 3 >> 找到最大元素是6,对应位置是x=2,y=3,就是第2行,第... 阅读全文
posted @ 2014-01-16 14:57 helloweworld 阅读(3173) 评论(0) 推荐(0) 编辑
摘要: 画柱状图 矩阵的一列为一组,每一行的颜色相同. %data %1 2%4 5%2 3data = [1,2;4,5;2,3];b = bar(data);ch = get(b,'children');set(gca,'XTickLabel',{'第一行','第二行','第三行'}); %横坐标每行的标号( 1 2、4 5、2 3三行)。legend('第一列','第二列'); 阅读全文
posted @ 2014-01-16 14:50 helloweworld 阅读(3159) 评论(0) 推荐(0) 编辑
摘要: 求矩阵A某行的和 A = [1,2,3;4,5,6;7,8,9]B=sum(A,2)B(2) A = 1 2 3 4 5 6 7 8 9 B = 6 15 24 ans = 15 阅读全文
posted @ 2014-01-16 14:47 helloweworld 阅读(1086) 评论(0) 推荐(0) 编辑
摘要: 求矩阵A每行的最大值和该最大值对应的列号 A = [22,1,3,0,2;11,23,43,55,5][maxA,col]=max(A');maxA'col' A = 22 1 3 0 2 11 23 43 55 5 ans = 22 55 ans = 1 4 阅读全文
posted @ 2014-01-16 14:46 helloweworld 阅读(2035) 评论(0) 推荐(0) 编辑
摘要: 取矩阵A的某一行 A = [22,1,3,0,2;11,23,43,55,5]A(2,:) A = 22 1 3 0 2 11 23 43 55 5 ans = 11 23 43 55 5 阅读全文
posted @ 2014-01-16 14:44 helloweworld 阅读(1544) 评论(0) 推荐(0) 编辑
摘要: 1.创建bundle路径。 mkdir ~/.vim/bundle 2.clone vundle项目。git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle(第一次clone没创建vundle路径时失败,难道还要创建vundle路径?)3.在.vimrc或/etc/vim/vimrc里添加下面内容。注:如果没有.vi... 阅读全文
posted @ 2014-01-15 15:40 helloweworld 阅读(465) 评论(0) 推荐(0) 编辑
摘要: //main.cpp#include #include void worker(){ std::cout << "another thread";}int main(){ std::thread t(worker); std::cout << "main thread" << std::endl; t.join(); return 0;}编译:g++ main.cp... 阅读全文
posted @ 2014-01-13 21:25 helloweworld 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 如查看g++版本 方式一: g++ –version 方式二: dpkg –s g++ 方式三: apt-cache show g++ 阅读全文
posted @ 2014-01-13 21:07 helloweworld 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 一、传递一个参数。 #include #include using namespace std; void* thr_fn(void* arg){ int i = *(int*)arg; cout #include using namespace std; struct parameter{ char a; int i; float f;}; void* thr_fn(void* ar... 阅读全文
posted @ 2014-01-07 22:58 helloweworld 阅读(4212) 评论(0) 推荐(0) 编辑
摘要: Pig Toolbox插件 阅读全文
posted @ 2014-01-06 21:46 helloweworld 阅读(875) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 48 下一页