我正在使用简单的矩阵并且得到了一些奇怪的东西。
A =
2 3
5 6
8 9
我这样做了。
A([1 3],[1 2 2])
ans =
2 3 3
8 9 9
我这样做了。
A([1 3],[1 2])
ans =
2 3
8 9
我无法弄清楚为什么MatLab会有这样的结果。
或者更一般地说,A(输入)在最常见的输入中做了什么?
答案 0 :(得分:5)
var txt : String = "11111\n222222222222222\t333\t44444444\t555555\n66666\t77777777\t88\t99999\naaaa\tbbbbbbbb\tcccccccc\tddd";
txtBox.text = txt;
txtBox.setStyle("tabStops", "e200 c250 s300");
<s:RichText id="txtBox" top="25" left="25" width="600" height="200" />
从A(input)
传递的索引生成矩阵。简单的例子是
input
来自你的例子
A(1,1) # select the element from first row, first column
A(2,:) # select the complete second row
A(:,2) # select the complete second column
A([1 2],1) # select the element from the first and second row and first column each
类似
A([1 3],[1 2 2]) # Select elements from first row and first and two times second column
#as well as third row with first and two times second column.