【Matlab开发】matlab中norm范数以及向量点积、绘图设置相关

标签(空格分隔): 【Matlab开发】


声明:引用请注明出处http://blog.csdn.net/lg1259156776/


norm范数使用

help norm
norm Matrix or vector norm.
norm(X,2) returns the 2-norm of X. norm(X) is the same as norm(X,2). norm(X,1) returns the 1-norm of X. norm(X,Inf) returns the infinity norm of X. norm(X,'fro') returns the Frobenius norm of X.

在对某一个数组进行normalization的时候用起来十分方便,直接 X/norm(X)即可。

向量点积

>> help dot
dot Vector dot product.
C = dot(A,B) returns the scalar product of the vectors A and B.
A and B must be vectors of the same length. When A and B are both
column vectors, dot(A,B) is the same as A'*B.

点积跟点乘的区别需要注意一下,点积得到的是乘加,点乘不相加。

绘图设置相关

1.坐标轴设置

范围设置:

a. axis([xmin xmax ymin ymax])设置坐标轴在指定的区间

b. axis auto 将当前绘图区的坐标轴范围设置为MATLAB自动调整的区间

c. axis manual 冻结当前坐标轴范围,以后叠加绘图都在当前坐标轴范围内显示

d. axis tight 采用紧密模式设置当前坐标轴范围,即以用户数据范围为坐标轴范围比例:

a. axis equal 等比例坐标轴

b. axis square 以当前坐标轴范围为基础,将坐标轴区域调整为方格形

c. axis normal 自动调整纵横轴比例,使当前坐标轴范围内的图形显示达到最佳效果

范围选项和比例设置可以联合使用,默认的设置为axis auto normal

2.坐标轴刻度设置

set(gca, ’XTick’, [0 1 2]) X坐标轴刻度数据点位置

set(gca,’XTickLabel’,{‘a’,’b’,’c’}) X坐标轴刻度处显示的字符

set(gca,’FontName’,’Times New Roman’,’FontSize’,14)设置坐标轴刻度字体名称,大小

‘FontWeight’,’bold’ 加粗 ‘FontAngle’,’italic’ 斜体

对字体的设置也可以用在title, xlabel, ylabel等中

3.图例

legend(‘a’,’Location’,’best’) 图例位置放在最佳位置

4.设置曲线线宽、标记点大小,标记点边框颜色和标记点填充颜色等

plot(…,’Property Name’, Property Value, …)

Property Name 意义 选项

LineWidth 线宽 数值,如0.5,1等,单位为points

MarkerEdgeColor 标记点边框线条颜色颜色字符,如’g’, ’b’等

MarkerFaceColor 标记点内部区域填充颜色颜色字符

MarkerSize 标记点大小 数值,单位为points

a=linspace(1,2,10)
plot(a,'--pr','linewidth',1.5,'MarkerEdgeColor','r','MarkerFaceColor','m','MarkerSize',10)
legend('a','Location','best')
title('a','FontName','Times New Roman','FontWeight','Bold','FontSize',16)
xlabel('T','FontName','Times New Roman','FontSize',14)
ylabel('a','FontName','Times New Roman','FontSize',14,'Rotation',0)
axis auto equal
set(gca,'FontName','Times New Roman','FontSize',14)

2015-11-06 调试总结 张朋艺

最新文章

  1. [转] 将DOS格式文本文件转换成UNIX格式
  2. gRaphael——JavaScript 矢量图表库:两行代码实现精美图表
  3. 数据库存储ATM机,开户、查询等信息
  4. codeforces 577B B. Modulo Sum(水题)
  5. PreparedStatement接口及其方法的使用
  6. UVa 103 Stacking Boxes --- DAG上的动态规划
  7. Java 关于中文乱码处理的经验总结【转载】
  8. 使用solr报错,错误信息 include(SolrClient.php): failed to open stream: No such file or directory
  9. USM锐化之openCV实现,附赠调整对比度函数
  10. JDK源码学习系列05----LinkedList
  11. pandas笔记
  12. Spring异常之版本错误
  13. redis.conf常用配置说明
  14. js编码解码 punyCode
  15. MySQL基于LVM快照的备份恢复(临时)
  16. 使用ado.net打造通用的数据库操作类
  17. 在win10下安装eclipse
  18. C语言强化——排序
  19. word count程序,以及困扰人的宽字符与字符
  20. [转]Greenplum 通过gpfdist + EXTERNAL TABLE 并行导入数据

热门文章

  1. 洛谷1546 最短网络Agri-Net【最小生成树】【prim】
  2. BZOJ 2127 / Luogu P1646 [国家集训队]happiness (最小割)
  3. 用python做数据分析4|pandas库介绍之DataFrame基本操作
  4. P3355 骑士共存问题【洛谷】(二分图最大独立集变形题) //链接矩阵存图
  5. WSDL的学习
  6. 数据库学习之三--Select查询及运算符
  7. leetcode解题报告(8):Remove Element
  8. [Qt Quick] qmlscene 工具的使用
  9. 动手动脑(ppt中6个问题)
  10. CF1206A