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

相关推荐
机器学习之心13 小时前
机器人路径规划 | 基于极光PLO优化算法的机器人三维路径规划Matlab代码
算法·matlab·机器人·三维路径规划
IT猿手16 小时前
2025最新智能优化算法:改进型雪雁算法(Improved Snow Geese Algorithm, ISGA)求解23个经典函数测试集,MATLAB
数据库·人工智能·算法·机器学习·matlab
谁不学习揍谁!20 小时前
基于Django快递物流管理可视化分析系统(完整系统源码+数据库+详细开发文档+万字详细论文+答辩PPT+详细部署教程等资料)
数据库·人工智能·后端·python·django·数据可视化
Jackson@ML1 天前
Python数据可视化简介
开发语言·python·数据可视化
studyer_domi1 天前
matlab质子磁力仪传感器线圈参数绘图
人工智能·matlab
青橘MATLAB学习2 天前
模糊综合评价法:原理、步骤与MATLAB实现
开发语言·算法·数学建模·matlab·分类
studyer_domi2 天前
matlab 三维时频图绘制
开发语言·matlab
四棱子2 天前
olcs插件实现二三维地图切换
前端·数据可视化
studyer_domi2 天前
matlab飞行姿态pid控制
matlab
Matlab仿真实验室2 天前
基于Matlab实现信道估计仿真(源码)
开发语言·matlab·信道估计仿真