matlab实用命令
实用命令
打点测时
在需要测量的开始部分标记: tic
在需要测量的结束部分标记: toc
记录程序从tic到toc运行所花费的时间
Image 翻转
fliplr(x) //左右翻转
flipud(x) //上下翻转
rot90(x) //旋转九十度
find non-zero elem index
%tipycally method to find the non-zero elem index in 2D matrix.
indices = find(matrix); %find non-zero elem by rows, return rank.
[I, J] = ind2sub(size(matrix), indices); %convert rank to row and col index
read multifile in certain directory
%a typical method for reading data from multitxt and merge them together.
datapath = ''% datapath = 'data/tennis/';
filelist = dir([datapath '/*.jpg']);
imagelist = {filelist.name};
for i = 1:nImg
ld = dlmread([datapath imagelist{i}(1:end-4) '.jpg.txt']);
w_gt = [w_gt; ld'];
end
Write and read .txt file
读写矩阵
dlmwrite('xpreds_3d.txt',preds_3d); //store preds_3d matrix, it can only store 2 demension matrix
M = dlmread('inputdata/o-ldmk.txt');
//if demension is more than 2 ,it will merge from second dimension
读写文本
fp = fopen(fileOut,'w');
fprintf(fp,'%d %d',m,n);
fclose(fp);
dlmwrite(fileOut,data1,'-append','delimiter',' ','roffset',1,'coffset',0); //以空格结尾
save and load .mat
save(‘xx.mat’, ‘varname’)则变量varname会被保存在当前目录下xx.mat文件。
再要使用变量时只要用load(‘xx.mat’)变量会被读入。
如果使用xx = load(‘xx.mat’)读入,则xx.xx为真正的存入变量。
Repmat
A = [1 2; 3 4];
B = repmat(A, [2 3 2]);
//以A为子模块,把B复制成2行3列元素为A的大矩阵,并且这样的矩阵有两份
std2

std2(matrix) = sqrt( 1/(size(matrix,1)*size(matrix,2)) * sum( (mean(matrix(:)) - matrix ))(:) );
matlab实用命令的更多相关文章
- 安装mysql数据库中的技巧、错误排查以及实用命令(持续更新)
针对解压版本5.7.16(博主使用的这个版本.在某些低版本中部分命令失效) 一.初始化data目录(解压版解压后没有data目录) mysqld --initialize-insecure --use ...
- NoSQL之Redis高级实用命令详解--安全和主从复制
Android IOS JavaScript HTML5 CSS jQuery Python PHP NodeJS Java Spring MySQL MongoDB Redis NOSQL Vim ...
- Sysstat性能监控工具包中20个实用命令
Sysstat性能监控工具包中20个实用命令 学习mpstat, pidstat, iostat和sar等工具,这些工具可以帮组我们找出系统中的问题.这些工具都包含了不同的选项,这意味着你可以根据不同 ...
- Windows实用命令
Windows实用命令 # 统计ESTABLISHED状态下的连接一共有多少个/c是统计行数,/i是忽略大小写 netstat -ano|find /i "established&qu ...
- 14: linux实用命令
1.1 基本实用命令整理 1.查找大文件文件 du -sh ./*|grep G # 查看当前目录下个文件大于1G的文件夹 2.查找日志文件中 5xx数量,并进行排序 ...
- Matlab 快捷键 命令
1. 在命令窗口(Command Window)中: 1) [上.下键]――切换到之前.之后的命令,可以重复按多次来达到你想要的命令 2) clc――清除命令窗口显示的语句,此命令并不清空当前工作区的 ...
- Linux Tomcat日志查看实用命令
实用命令: 查看tomcat运行日志 tail -f catalina.out 通过关键字搜索查看日志 cat jeewx-2015-09-20.log | grep 验证码 查看固定时间日志 cat ...
- GDB调试实用命令
个人感觉从windows平台转到linux平台一个不适应的地方就是调试器的使用.因为windows下调试器基本上都依赖快捷键和图像界面来完成操作,就算是windbg这种伪命令行的工具,命令也很简单比较 ...
- Redis 相关功能和实用命令(五)
慢查询原因分析 由于 Redis 是单线程的,它内部维护了一个命令队列,所以当有耗时的命令出现时,比如 keys *,后面的命令会被阻塞,通查查出慢查询可以对服务进一步优化. 设置慢查询阀值:默认10 ...
随机推荐
- 【初级算法】6. 两个数组的交集 II
题目如下: 给定两个数组,写一个方法来计算它们的交集. 例如: 给定 nums1 = [, , , ], nums2 = [, ], 返回 [, ]. 注意: 输出结果中每个元素出现的次数,应与元素在 ...
- SQL Server 2008设置主键为自增
环境:SQL Server 2008 问题:设置主键,将主键设为自增. 解决:点击table->选中表->design->选中需要设置主键的字段,单击右键"设置主键&quo ...
- [ssh]ssh系列之一
1.使用ssh建立sock代理 ssh -D 7070 -f -N user@host -D -f 后台执行 -N 不登陆shell执行
- 【转载】Innodb共享表空间VS独立表空间
http://www.mysqlsupport.cn/innodb%E5%85%B1%E4%BA%AB%E8%A1%A8%E7%A9%BA%E9%97%B4vs%E7%8B%AC%E7%AB%8B%E ...
- HDU1573 线性同余方程(解的个数)
X问题 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...
- Makefile $@,$^,$ 作用
/* main.c */ #include "mytool1.h" #include "mytool2.h" int ...
- [洛谷3457][POI2007]POW-The Flood
洛谷题目链接:[POI2007]POW-The Flood 题意翻译 Description 你手头有一张该市的地图.这张地图是边长为 m∗n 的矩形,被划分为m∗n个1∗1的小正方形.对于每个小正方 ...
- MapperScannerConfigurer不 property-placeholder
关于org.mybatis.spring.mapper.MapperScannerConfigurer不支持 property-placeholder 参考了http://www.oschina.ne ...
- 工程化管理--maven
mavne模型 可以看出 maven构件都是由插件支撑的 maven的插件位置在:F:\MavenRepository\org\apache\maven\plugins Maven仓库布局 本地仓库 ...
- 【shell】shell中各种括号的作用()、(())、[]、[[]]、{}
一.小括号,圆括号() 1.单小括号 () ①命令组.括号中的命令将会新开一个子shell顺序执行,所以括号中的变量不能够被脚本余下的部分使用.括号中多个命令之间用分号隔开,最后一个命令可以没有 ...