agentsclimarketplace

Matlab向量和矩阵的零填充平移

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/matlab向量和矩阵的零填充平移

在MATLAB中实现向量和矩阵的线性平移,平移后空出的位置补0,保持原始维度不变,并要求代码简洁。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill matlab向量和矩阵的零填充平移

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.8 KB, 486 tokens by cl100k_base, as published. Nobody here has run it

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 非循环平移

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.