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

相关推荐
iCxhust3 小时前
反Park+反Clarke变换
matlab
bazhange4 小时前
python如何像matlab一样使用向量化替代for循环
开发语言·python·matlab
Evand J5 小时前
【MATLAB代码介绍】EKF+CKF对比程序
matlab·ekf·非线性滤波·ckf
RestCloud6 小时前
2026年企业级ETL工具选型指南:从开源DataX到商业化ETLCloud的演进
数据仓库·开源·etl·datax·数据处理·数据集成·数据传输
yu85939587 小时前
matlab雷达信号与干扰的仿真
开发语言·matlab
CodeCraft Studio9 小时前
高性能图表库SciChart助力机器人实现实时AI驱动的性能提升
人工智能·信息可视化·机器人·数据可视化·scichart·高性能图表库·wpf图表库
我爱C编程10 小时前
基于分层QLearning强化学习的联合抗干扰算法matlab仿真
matlab·强化学习·分层qlearning·联合抗干扰
GIS地信小匠11 小时前
(27)ArcGIS Pro 范围内汇总、汇总统计数据与交集制表:空间统计三工具全攻略
arcgis·空间分析·数据处理·国土空间规划·空间统计·gis教程·arcgls pro
沅_Yuan11 小时前
基于核密度估计的Transformer-LSTM-KDE多输入单输出回归模型【MATLAB】
matlab·回归·lstm·transformer·核密度估计·kde
码云之上11 小时前
从 SQL DDL 到 ER 图:前端如何优雅地实现数据库可视化
前端·数据库·数据可视化