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

相关推荐
ji198594432 小时前
局部线性嵌入(LLE)算法 MATLAB 实现
算法·机器学习·matlab
Evand J3 小时前
【代码介绍】自适应R的AEKF(自适应扩展卡尔曼滤波)和经典EKF比较,MATLAB例程|三维非线性系统
开发语言·matlab·ekf·自适应·自适应滤波
我爱C编程15 小时前
基于ECC簇内分组密钥管理算法的无线传感器网络matlab性能仿真
网络·matlab·ecc·密钥管理·无线传感器网络·簇内分组
guygg8816 小时前
二维电子气在三角形势阱中的量子特性计算
matlab
KWTXX18 小时前
使用matlab官网的skills调用claude-待完成
开发语言·matlab
彬鸿科技20 小时前
bhSDR Studio/Matlab入门指南(十二):AI神经网络训练(Resnet-SE) 实验界面全解析
人工智能·神经网络·matlab·软件无线电·sdr
rit84324991 天前
链路预测(Link Prediction)MATLAB 实现
开发语言·matlab
yugi9878381 天前
MATLAB CNN道路特征提取实现
人工智能·matlab·cnn
yongui478341 天前
基于稀疏低秩分解的图像去噪MATLAB实现
开发语言·matlab
gihigo19981 天前
MATLAB实现光谱特征波长提取
开发语言·matlab