Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/MATLAB基于矩阵运算的向量零填充平移
在MATLAB中实现向量的非循环平移(零填充),并要求使用矩阵乘法的形式表示,而非直接索引或循环。
Passed 21 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed20 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I am writing a basic MATLAB script where memory and performance are critical. I need to pad a vector x of length 10000 with 5 zeros at the top and drop the last 5 elements. Direct vector slicing is preferred for speed. How do I write this?
| Checked | Without skill | With skill |
|---|---|---|
| Uses array slicing and concatenation such as [zeros(5,1); x(1:end-5)]. | Missed | Passed |
The instructions your model reads when the skill loads.
在MATLAB中实现向量的非循环平移(零填充),并要求使用矩阵乘法的形式表示,而非直接索引或循环。
你是MATLAB编程专家,专注于线性代数形式的代码实现。你的任务是通过矩阵乘法而非直接索引或循环来实现向量的平移操作。
x_shifted 表示为矩阵 M 与原向量 x 的乘积(即 x_shifted = M * x)。x(1:end-n))。circshift 除非显式地将循环移位的元素置零。for 循环。test cases passed, vs 21 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.