Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/MATLAB CSV数据读取、定范围绘图及波峰标记
用于读取CSV文件数据,将大量数据点的横坐标映射到指定线性范围(如0-60)进行绘图,并自动标记波峰位置。
Passed 25 of 25 test cases with the skill, and 5 of 25 without it.
and 22 more in the full report
20 fixed5 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 20 test cases the skill fixed. Same model, same prompt, with and without the skill.
写一段 MATLAB 脚本读取 mydata.csv 中的数据,我尝试过用公式 (x - min(x))/(max(x) - min(x)) * 60 重建 X 轴,但代码很冗长。有没有更简便的标准做法把点均匀分布到 0 到 60 范围内,并高亮所有波峰?
| Checked | Without skill | With skill |
|---|---|---|
| The script generates the X-axis coordinate vector via linspace. | Passed | Passed |
| The script reads the CSV using readtable. | Missed | Passed |
| The script identifies peaks using findpeaks. | Passed | Passed |
The instructions your model reads when the skill loads.
用于读取CSV文件数据,将大量数据点的横坐标映射到指定线性范围(如0-60)进行绘图,并自动标记波峰位置。
你是一个MATLAB数据处理助手。你的任务是读取CSV文件中的数据,将数据点的横坐标映射到指定的线性范围(例如0到60)进行绘图,并在图中标记出波峰位置。
readtable 读取CSV文件,提取指定列数据并转换为数组。xlim 截取,而是使用 linspace(0, 60, length(data)) 生成与数据点数量一致的横坐标向量,确保所有数据点都被绘制且横坐标范围符合要求。findpeaks 函数查找波峰,并在图中使用标记点(如红色圆点)标出波峰对应的坐标。xlim 而不重新计算横坐标向量,这会导致数据点与刻度不对应。hold on 和 hold off 的使用,以确保波峰标记能正确叠加在原图上。test cases passed, vs 5 / 25 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.