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

相关推荐
CoovallyAIHub10 小时前
客户问交期、报价、配置?销售最值钱的时间不该花在翻资料上,这中间差了一张客户信息拼图
agent·数据可视化
一晌小贪欢10 小时前
Python办公14:批量解压文件夹内的所有 ZIP/RAR 并自动分类
开发语言·python·excel·数据可视化·python办公
吃好睡好便好11 小时前
取整函数的使用
学习·matlab·生活·取整函数
Funing71 天前
STM32 电机动态 PI 控制:从编码器反馈、增量式 PI 到 Matlab 参数拟合与 PWM 输出
stm32·嵌入式硬件·matlab·pi控制算法
躺柒1 天前
读数据可视化13空间标量场(上)
人工智能·深度学习·信息可视化·数据可视化·空间·大数据分析
zq_63891 天前
利用 MATLAB 调用 STK Object Model COM 显示雷达受干扰前后探测范围的变化
开发语言·matlab
zq_63892 天前
ObjectModel_diagram.pdf 文档详细总结
开发语言·matlab
数据智研2 天前
【数据分享】阿庐风景名胜区(国家级地质公园)边界数据
人工智能·数据分析·数据可视化
88号技师2 天前
2026年SCI-分数牛顿衍生优化算法Fractional Newton-derived optimizer-附Matlab免费代码
开发语言·算法·数学建模·matlab·优化算法
机器学习之心2 天前
LSTM神经网络+SHAP可解释性分析+NSGA-II工艺参数优化,从预测到可解释性再到多目标优化的全流程实战,MATLAB代码
神经网络·matlab·lstm·shap可解释性分析·nsga-ii工艺参数优化