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

相关推荐
2zcode18 小时前
基于MATLAB语音信号分析与机器学习的帕金森病智能检测系统
人工智能·机器学习·matlab
daad77718 小时前
记录vscode连接matlab启动环境搭建
java·vscode·matlab
DolitD1 天前
无人机×云渲染:点量云流实时交互云推流方案
3d·云计算·数据可视化·虚拟现实
2zcode2 天前
基于MATLAB形态学与高斯滤波的医学图像自适应增强算法研究
算法·计算机视觉·matlab
last_zhiyin2 天前
一步步上手ETL工具之------Informatica PowerCenter
数据仓库·etl·数据处理·powercenter·informatica
2zcode2 天前
免费开源项目文档:基于MATLAB卷积神经网络的口罩佩戴检测系统
开发语言·matlab·cnn
2zcode3 天前
基于MATLAB卷积神经网络的口罩佩戴检测系统
开发语言·matlab·cnn
2zcode3 天前
免费开源项目文档:基于MATLAB同态滤波的医学图像增强系统设计与实现
开发语言·matlab
2zcode3 天前
基于MATLAB同态滤波的医学图像增强系统设计与实现
开发语言·计算机视觉·matlab
机器学习之心3 天前
基于遗传粒子群混合算法的无人机三维路径规划:Matlab 实现与多算法对比分析
算法·matlab·无人机·无人机三维路径规划·遗传粒子群混合算法