很多朋友对于高效MATLAB编程技巧与应用解析和不太懂,今天就由小编来为大家分享,希望可以帮助到大家,下面一起来看看吧!
Code:
%% 绘制3y轴的图形;
字体大小=24;
axesPosition=[250 100 1100 600];%# 轴位置,以像素为单位
yWidth=60;%# y 轴间距,以像素为单位
xLimit=[1 10];%# x值的范围
xOffset=-yWidth*diff(xLimit)/axesPosition(3);
x=[1:10];y1=sin(x);y2=cos(x);y3=tan(x);
%# 创建图形和轴:
% 绘制第一个数据
图("单位","像素","位置",[100 100 1500 800]);
h1=轴("单位","像素","位置",axesPosition,
"颜色","w","XColor","k","YColor","r",
"XLim",xLimit,"YLim",[-5 5],"NextPlot","add");
绘图(h1,x,y1,"-sc","颜色",[0.7 0.2 0.2],"线宽",3);坚持;
legend(h1,"y1","位置","西北","方向","水平","方框","关闭","字体名称","Times New Roman","FontWeight","粗体", "字体大小",字体大小);
set(h1,"FontSize",fontsize,"FontName","Times New Roman","FontWeight","bold","ycolor",[0.7 0.2 0.2]);
xlabel(h1,"Num","FontSize",fontsize,"FontName","Times New Roman","FontWeight","bold");
ylabel(h1,"y1","FontSize",fontsize,"FontName","Times New Roman","FontWeight","bold")
% 绘制第二个数据
h2=轴("单位","像素","位置",axesPosition,"yaxislocation","右",
"颜色","无","XColor","k","YColor","m",
"XLim",xLimit,"YLim",[-5 5],
"XTick",[],"XTickLabel",[],"NextPlot","添加");
绘图(h2,x,y2,"-oc","颜色",[0.4 0.5 0.2],"线宽",3);坚持;
set(h2,"FontSize",fontsize,"FontName","Times New Roman","FontWeight","bold","ycolor",[0.4 0.5 0.2]);
legend(h2,"y2","位置","北","方向","水平","box","关闭","字体名称","Times New Roman","FontWeight","粗体", "字体大小",字体大小);
ylabel(h2,"y2","FontSize",fontsize,"FontName","Times New Roman","FontWeight","bold")
%绘制第三个数据
h3=轴("单位","像素","位置",axesPosition+yWidth.*[-2 0 2 0],
"颜色","无","XColor","k","YColor","b",
"XLim",xLimit+[2*xOffset 0],"YLim",[-5 5],
"XTick",[],"XTickLabel",[],"NextPlot","添加");
绘图(h3,x,y3,"-oc","颜色",[0.3 0.5 0.7],"LineWidth",3);保持
legend(h3,"y3","位置","东北","方向","水平","方框","关闭","字体名称","Times New Roman","FontWeight","粗体", "字体大小",字体大小);
set(h3,"FontSize",fontsize,"FontName","Times New Roman","FontWeight","bold","ycolor",[0.3 0.5 0.7]);
【高效MATLAB编程技巧与应用解析】相关文章:
2.米颠拜石
3.王羲之临池学书
8.郑板桥轶事十则
用户评论
MATLAB真是太牛了吧,想做什么都能干!
有8位网友表示赞同!
学习MATLAB感觉自己进步了很多,越来越会编程了。
有8位网友表示赞同!
之前学过Python和C++,觉得MATLAB还是比较方便操作的。
有18位网友表示赞同!
MATLAB用的领域真广泛啊,航空航天、金融计算都有用到。
有7位网友表示赞同!
大学专业要用到MATLAB,感觉还挺好玩的,能把数学模型拟合出来!
有12位网友表示赞同!
想做机器学习研究,听说MATLAB也很厉害吧?
有7位网友表示赞同!
MATLAB的图形界面确实很强大,画图的效果太棒了。
有19位网友表示赞同!
在网上找MATLAB教程看很多,感觉还是比较容易上手的。
有13位网友表示赞同!
用MATLAB模拟仿真可以帮我更好地理解原理啊!
有13位网友表示赞同!
matlab 的工具箱功能也太多了吧,都能满足各种需求。
有12位网友表示赞同!
最近刚入手一台高性能电脑,想试试在MATLAB上做一些大数据分析。
有14位网友表示赞同!
听说MATLAB的编程效率很高?比Python还快?
有12位网友表示赞同!
MATLAB的中文支持还是不错的,很多文献资料都能看懂。
有15位网友表示赞同!
学习MATLAB可以拓展我的研究方向,很希望能学好它!
有18位网友表示赞同!
想要在MATLAB上实现一些算法的具体逻辑,不知道要怎么操作呢?
有6位网友表示赞同!
看到别人用MATLAB做出的模型真是太震撼了,感觉技术水平高强啊。
有14位网友表示赞同!
matlab 还有哪些隐藏的功能可以分享一下吗?
有12位网友表示赞同!
想通过MATLAB学习深入理解一些科学领域知识!
有20位网友表示赞同!
MATLAB 的学习资源特别丰富,很多免费的网站和教程都可以参考。
有10位网友表示赞同!
用MATLAB可以完成我之前一直想做的小项目!
有8位网友表示赞同!
期待在MATLAB学习上取得更好的进步!
有8位网友表示赞同!