• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

matlab基本指令

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

基本命令

close all                                //关闭所有figure 命令打开的窗口,在命令窗口输入
clear all                                 //清除之前运行程序所存下的所有变量
 
size(mat)
    a = [1 2 3 ; 4 5 6 ]
    size(a) = [2 3]                                   //size(mat) = [rownum, colnum]

delete certain col in mtrix

A = [1 2 3 ; 4 5 6 ; 7 8 9];
A(:, 3) = [];

reshape array

z = reshape(preds(3,:,:),14,177);   //it will reduce demension of preds to 14X177
A = [1 2; 3 4]; permute(A,[2 1])    %%convert div 2 with div 1.
ans =
     1     3
     2     4
cat      %%merge matrix A ,B to a new matrix, extend div possibly
heatmap = cat(4,heatmap,hm)

矩阵连接

[s1 s2]    %%右侧连接
[s1; s2]   %%下侧连接

convert num to string

num2str

convert a cell struct to mat type

cell2mat
waitforbuttonpress: you can put it into for loop
subs = regexp(string, 'c', 'split');  %%将string以'c'为分隔符分割为若干子串并保存至subs中

%%注意:subs是一个cell型数据,其每个元素是cell型的,只能display,不能直接进行字符串操作(如截取或者连接),这时需要字符转换:如,s1=char(subs(1))

画图

hist(x);   %%show the 2-D array x' hist 

mesh(Z)     %%plot 3D figure, where Z is f(m ,n).

I = imgaussfilt(I, 'FilterSize', 11);   %%I is image, 11 is size of filter size

连接图

plot(y)  //默认x坐标为正整数
plot(x, y) 
hold on     //表示下次画图基于本图

散点图

scatter(x, y)  //以x,y为横纵坐标画散点
scatter(x, y, ‘filled’)      也可以改为 ‘rx’     //即以不同元素表示散点 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi视频教程发布时间:2022-07-18
下一篇:
Delphi动态添加菜单发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap