1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
function [stk,txt,top]=sci_quiver()
// Copyright INRIA
txt=[]
select rhs
case 2 then //quiver(U,V)
nx=gettempvar(1)
ny=gettempvar(2)
txt=[nx+' = 1:size('+stk(top-1)(1)+'''*'')'
nx+' = ['+nx+';'+nx+' + matrix('+stk(top-1)(1)+',1,-1)]'
ny+' = 1:size('+stk(top)(1)+'''*'')'
ny+' = ['+ny+';'+ny+' + matrix('+stk(top)(1)+',1,-1)]']
case 3 then //quiver(U,V,linespec) or quiver(U,V,scale)
if stk(top)(5)=='10' then //quiver(U,V,linespec)
set_infos('quiver '+stk(top)(1)+' option not yet handled',1)
elseif stk(top)(5)=='1' then //quiver(U,V,scale)
set_infos('quiver '+stk(top)(1)+' option not yet handled',1)
else //??
set_infos('quiver '+stk(top)(1)+' option not yet handled',1)
end
nx=gettempvar(1)
ny=gettempvar(2)
txt=[nx+' = 1:size('+stk(top-2)(1)+'''*'')'
nx+' = ['+nx+';'+nx+' + matrix('+stk(top-2)(1)+',1,-1)]'
ny+' = 1:size('+stk(top-1)(1)+'''*'')'
ny+' = ['+ny+';'+ny+' + matrix('+stk(top-1)(1)+',1,-1)]']
case 4 then //quiver(U,V,linespec,'filled') or quiver(X,Y,U,V)
if stk(top)(5)<>'10' then //quiver(x,y,u,v)
nx=gettempvar(1)
ny=gettempvar(2)
txt=[nx+' = matrix('+stk(top-3)(1)+',1,-1)'
nx+' = ['+nx+';'+nx+' + matrix('+stk(top-1)(1)+',1,-1)]'
nx+' = matrix('+stk(top-2)(1)+',1,-1)'
ny+' = ['+ny+';'+ny+' + matrix('+stk(top)(1)+',1,-1)]']
else
set_infos('quiver '+stk(top-1)(1)+' option not yet handled',1)
end
case 5 then //quiver(X,Y,U,V,linespec) or quiver(X,Y,U,V,scale)
set_infos('quiver '+stk(top)(1)+' option not yet handled',1)
nx=gettempvar(1)
ny=gettempvar(2)
txt=[nx+' = matrix('+stk(top-3)(1)+',1,-1)'
nx+' = ['+nx+';'+nx+' + matrix('+stk(top-1)(1)+',1,-1)]'
nx+' = matrix('+stk(top-2)(1)+',1,-1)'
ny+' = ['+ny+';'+ny+' + matrix('+stk(top)(1)+',1,-1)]']
case 6 then //quiver(X,Y,U,V,linespec,'filled')
set_infos('quiver '+stk(top)(1)+' option not yet handled',1)
nx=gettempvar(1)
ny=gettempvar(2)
txt=[nx+' = matrix('+stk(top-3)(1)+',1,-1)'
nx+' = ['+nx+';'+nx+' + matrix('+stk(top-1)(1)+',1,-1)]'
nx+' = matrix('+stk(top-2)(1)+',1,-1)'
ny+' = ['+ny+';'+ny+' + matrix('+stk(top)(1)+',1,-1)]']
end
stk=list('xarrows'+rhsargs([nx,ny]),'0','?','?','?')
|