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

相关推荐
Q264336502310 分钟前
【有源码】基于 Hadoop 的强化学习智能体轨迹数据挖掘与可视化分析系统大数据毕设项目
大数据·hadoop·机器学习·数据挖掘·spark·课程设计·数据可视化
菜鸟~noob2332 小时前
【电子战】第07篇:多普勒测向【含matlab代码】
android·开发语言·matlab
可编程芯片开发2 小时前
基于压电能量收集和MPPT最大功率跟踪算法的IoT压力传感器电源系统Simulink建模与仿真
物联网·matlab·simulink·mppt·压电能量收集·iot压力传感器
菜鸟~noob2332 小时前
【电子战】第12篇:TDOA 定位——双曲线与等时差线【含matlab代码】
开发语言·matlab
敲敲敲敲暴你脑袋3 小时前
地图瓦片批量改色来啦!
node.js·gis·数据可视化
柳杉3 小时前
从调研到闭环,我用 GPT-Image-2.5 和 GPT-6 Astra 把智慧厂房 3D 大屏这条链路走完了
前端·ai编程·数据可视化
菜鸟~noob23313 小时前
【电子战】 第09篇:阵列信号处理——波束形成、MVDR、MUSIC【含matlab代码】
开发语言·matlab·信号处理
菜鸟~noob23317 小时前
【电子战】第08篇:多普勒测向的工程实现与优化【含matlab代码】
开发语言·matlab
菜鸟~noob23317 小时前
【电子战】第06篇:干涉仪与相位差测向【含matlab代码】
开发语言·matlab
菜鸟~noob2331 天前
【电子战】测向精度极限——克拉美-罗下限(CRLB)与误差分析【含matlab代码】
开发语言·matlab