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

相关推荐
bubiyoushang88819 小时前
基于CLEAN算法的杂波抑制Matlab仿真实现
数据结构·算法·matlab
Evand J20 小时前
【MATLAB例程】雷达测距+测角的二维定位,基于CV运动的EKF和RTS平滑。滤波与平滑后的结果对比、误差分析。附例程
matlab·ekf·扩展卡尔曼滤波·rts平滑
guygg881 天前
5G PDSCH信道吞吐量MATLAB仿真实现(含信道生成与解调)
开发语言·5g·matlab
yugi9878381 天前
基于字典缩放的属性散射中心参数提取MATLAB仿真程序
开发语言·matlab
机器学习之心1 天前
MATLAB基于近红外光谱检测的菠萝含水率预测(多种预处理+PLS)
人工智能·算法·matlab·近红外光谱检测
kaikaile19951 天前
基于MATLAB的视频行人检测与跟踪系统实现
开发语言·matlab·音视频
FIT2CLOUD飞致云1 天前
在线地图交互优化,查询组件选项值支持过滤条件,DataEase开源BI工具v2.10.19 LTS版本发布
开源·数据可视化·dataease·bi·数据大屏
ghie90901 天前
基于MATLAB的多旋翼无人机多机编队仿真实现
开发语言·matlab·无人机
rit84324991 天前
UVE算法提取光谱特征波长的MATLAB实现与应用
开发语言·算法·matlab
fie88891 天前
基于MATLAB的时变Copula实现方案
开发语言·matlab