J:方便的输入矩阵的方法吗? [英] J: Handy method to enter a matrix?

查看:114
本文介绍了J:方便的输入矩阵的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个写在纸上的 n -by- m 矩阵,我想在J中对其进行计算.
我可以输入这样的矩阵( n = 3, m = 3):

I have a n-by-m matrix written at paper and I want to make calculations on it in J.
I can enter matrices like that (n = 3, m = 3):

   A =: 3 4 $ 1 3 2 4 7 8 1 2 2 0 0 1

问题是如何输入这样的矩阵:

The question is how to enter a matrix like that:

   A =: (something here)
1 3 2 4
7 8 1 2
2 0 0 1
)

之所以问这样一个奇怪的问题,是因为我在某本书中看到了一种类似的使用动词0 : 0或类似方式键入矩阵的方法,但我不记得在哪里. :{

The reason why I'm asking such a weird question is that I have seen in some book a similar method of typing matrices using verb 0 : 0 or something alike, but I cannot remember where. :{

推荐答案

我将(something here)用作(".;._2) 0 : 0.这样,我还可以混合使用表达式.

I use (something here) as (".;._2) 0 : 0. That way I can also mix expressions.

] A =: (".;._2) 0 : 0
5 $ 0
? 5 $ 5
5 $ 1
1 2 3 2 1
)
0 0 0 0 0
2 1 0 0 3
1 1 1 1 1
1 2 3 2 1

这篇关于J:方便的输入矩阵的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆