truckan.m
来自「FISMAT accommodates different arithmetic」· M 代码 · 共 27 行
M
27 行
function [ret,x0] = truckan(t,x,u,flag,ts,sys,cb)% ts=PlotIncrement% TRUCKAN S-function for making truck animation.if flag==0, % asking for sizes of parameters and initial conditions truck0(sys,cb); ret = [0 1 0 3 0 0]; x0 = 0;elseif flag==2, % return the discrete states ret = 0;elseif flag==4, % returns the next time interval for a discrete update % Next update at a tenth of a second from now ret = t+ts; % previously +0.1else ret = [];endif (flag==2) & (abs(round(t/ts) - t/ts) < 1e-8), fig = gcf; if strcmp(get(fig,'Name'),'truck visualisation'), ud = get(fig,'UserData'); truckset(t,ud,u); endend% end truckan
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?