18 Star 27 Fork 6

skywolf / StepMotor_Matlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
PlotResult.m 938 Bytes
一键复制 编辑 原始数据 按行查看 历史
%绘图,被StepMotor_xxx.m调用。计算出结果后才能运行。
if strcmp(ini.FigureDrawMode, 'hold')
h = gcf();
else
h=figure;
end
%选择当前plot颜色
StyleId = mod(FigureCnt,length(ini.PlotStyle)/2)+1;
FigureCnt = FigureCnt+1;
PlotStyle = ini.PlotStyle(StyleId*2-1: StyleId*2);
dAccStr{FigureCnt}=sprintf('%.2fHz/ms2',dAcc);
subplot(3,1,1);
stairs(A(1:Cnt, T_SUM),A(1:Cnt,FREQ),PlotStyle); %速度曲线
xlabel('时间(ms)');
ylabel('频率(Hz)');
xlim([0 SpeedUpTime+StepTime*2]);%多次绘图的xlim以最后一个为准
grid on;
hold on;
subplot(3,1,2);
stairs(A(1:Cnt, T_SUM)-StepTime,A(1:Cnt,ACC),PlotStyle); %加速度曲线
xlabel('时间(ms)');
ylabel('加速度(Hz/ms)');
xlim([0 SpeedUpTime+StepTime*2]);
legend(dAccStr);
grid on;
hold on;
subplot(3,1,3);
stairs(A(1:Cnt, T_SUM),A(1:Cnt,STEP_SUM)*StepLen,PlotStyle); %距离曲线
xlabel('时间(ms)');
ylabel('距离(mm)');
xlim([0 SpeedUpTime+StepTime*2]);
grid on;
hold on;
Matlab
1
https://gitee.com/dingtu/StepMotor_Matlab.git
git@gitee.com:dingtu/StepMotor_Matlab.git
dingtu
StepMotor_Matlab
StepMotor_Matlab
master

搜索帮助