例如,在 JSL 的绘图中有以下值
Color Levels([-7.28 -1.99 3.3 8.59 13.88]);
我如何以这种形式编写代码?
x1=-7.28;
x2=13.88;
Color Levels([x1 -1.99 3.3 8.59 x2]);
谢谢!
矩阵可能有点棘手,但这是我在这种情况下所做的:
x1 = -7.28;
x2 = 13.88;
Color Levels( (x1 |/ [-1.99 3.3 8.59]` |/ x2)` );
这使用矩阵连接运算符|/然后进行一些转置以使其具有正确的尺寸
如果使用 Matrix() 函数构造矩阵,则可以直接将变量作为参数调用。 例如:
x1=-7.28;
x2=13.88;
mat = matrix({x1,-1.99, 3.3, 8.59, x2})`
//notice the need to transpose; the syntax is easier to construct this way
这是一个更完整的动态构建整个矩阵的方法:
Names Default To Here( 1 );
x1=100000; x2=1000000; x3=10000000;
dt = Open( "$SAMPLE_DATA/PopAgeGroup.jmp" );
obj = dt << Bubble Plot(
X( :"Portion 0-19"n ),
Y( :"Portion60+"n ),
Sizes( :Pop ),
ID( :Country ),
Coloring( :Pop )
);
obj << Color Levels( matrix({x1,x2,x3})` );
我希望这有帮助!
@朱利安