MATLAB制图代码【第二版】

MATLAB制图代码【第二版】

文档描述

Code describtion: This code is version 2 used for processing the data from the simulation and experiment.

Time : 2023.9.3

Author: PEZHANG

这是在第一版基础上,迭代出的第二版MATLAB制图代码,第二版的特点是以handle 的形式控制图窗的properties,此种形式更加贴近MATLAB的内在。

前置知识

figure图窗分为曲线、坐标轴、图窗背景三部分,这三个部分可以通过handle的形式对其properties进行操纵。

源代码

c 复制代码
clc;clear
close all

% get x、y data
x = 0:pi/20:2*pi;
y = sin(x);

% get the properties of line
l = plot(x,y);
l.LineWidth = 1;

% get the properties of figure
h = gcf;
h.Color = 'w';
h.Units = 'centimeters';
h.Position = [25 10 15 9];

% get the properties of axes
ax = gca;
ax.YGrid = 'on';
ax.FontSize = 13;
ax.XLabel.String = '时间 (s)';
ax.YLabel.String = '振幅 (m)';
ax.Title.String = '示例-正弦曲线';
ax.GridLineStyle = '--';
ax.Box = 'off';
print('-djpeg','-r600','示例-正弦曲线')

代码运行结果图

参考资料

【1】https://www.youtube.com/watch?v=CNayChYLAV8

【2】https://www.youtube.com/watch?v=sPC1-7K6qNU

【3】https://blog.csdn.net/qq_50632468/article/details/129691250

相关推荐
机器学习之心HML5 小时前
MATLAB豆渣发酵工艺优化 - 基于响应面法结合遗传算法
matlab
码界筑梦坊5 小时前
327-基于Django的兰州空气质量大数据可视化分析系统
python·信息可视化·数据分析·django·毕业设计·数据可视化
aini_lovee1 天前
MATLAB基于小波技术的图像融合实现
开发语言·人工智能·matlab
3GPP仿真实验室1 天前
【Matlab源码】6G候选波形:OFDM-IM 增强仿真平台 DM、CI
开发语言·matlab·ci/cd
rit84324991 天前
MATLAB中Teager能量算子提取与解调信号的实现
开发语言·matlab
我找到地球的支点啦1 天前
通信扩展——扩频技术(超级详细,附带Matlab代码)
开发语言·matlab
砚边数影2 天前
数据可视化入门:Matplotlib 基础语法与折线图绘制
数据库·信息可视化·matplotlib·数据可视化·kingbase·数据库平替用金仓·金仓数据库
Dev7z2 天前
基于 MATLAB 的铣削切削力建模与仿真
开发语言·matlab
fengfuyao9852 天前
基于MATLAB的表面织构油润滑轴承故障频率提取(改进VMD算法)
人工智能·算法·matlab
机器学习之心2 天前
基于随机森林模型的轴承剩余寿命预测MATLAB实现!
算法·随机森林·matlab