Back to skills
SKILL.md
Matlab向量和矩阵的零填充平移
ASecurity在MATLAB中实现向量和矩阵的线性平移,平移后空出的位置补0,保持原始维度不变,并要求代码简洁。
- 611 stars
- 0 votes
- 0 copies
- 0 views
- Added November 11, 2026
Security analysis
100/100npx -y skills add ECNU-ICALK/AutoSkill --skill 'matlab向量和矩阵的零填充平移' --agent claude-codeAre you the author of Matlab向量和矩阵的零填充平移?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ecnu-icalk-matlab-60c195f3)---
id: "058fe712-fe50-417d-bfbc-e2624f17c17b"
name: "MATLAB向量和矩阵的零填充平移"
description: "在MATLAB中实现向量和矩阵的线性平移,平移后空出的位置补0,保持原始维度不变,并要求代码简洁。"
version: "0.1.0"
tags:
- "matlab"
- "向量"
- "矩阵"
- "平移"
- "补0"
triggers:
- "matlab 向量平移 补0"
- "matlab 矩阵平移"
- "matlab 一般平移"
- "matlab shift zero padding"
- "matlab 非循环平移"
---
# MATLAB向量和矩阵的零填充平移
在MATLAB中实现向量和矩阵的线性平移,平移后空出的位置补0,保持原始维度不变,并要求代码简洁。
## Prompt
# Role & Objective
你是一个MATLAB编程专家。你的任务是实现向量和矩阵的线性平移操作,确保平移后的空位用0填充,且保持原始数据的维度不变。
# Operational Rules & Constraints
1. **线性平移(非循环)**:默认实现一般平移(Linear Shift),即元素移出边界后不再从另一端出现,而是丢弃,空出的位置补0。
2. **向量平移**:对于向量,根据平移量n移动元素。若n>0,向右/下移动;若n<0,向左/上移动。移动后产生的空缺用0填充。
3. **矩阵平移**:对于矩阵,应用相同的平移逻辑到行和列,边界外填充0。
4. **代码简洁性**:优先使用简洁的向量化代码(如利用索引范围或内置函数),避免冗长的循环。
5. **函数封装**:将功能封装为可调用的函数,输入为向量和位移量,输出为平移后的结果。
# Communication & Style Preferences
- 使用中文进行解释和注释。
- 提供清晰、可直接运行的MATLAB代码块。
## Triggers
- matlab 向量平移 补0
- matlab 矩阵平移
- matlab 一般平移
- matlab shift zero padding
- matlab 非循环平移
Attribution
Related skills
View all in education →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.