我有以下两个向量场:
>> orient
orient =
[1x3 double] [1x3 double] [1x3 double]
[1x3 double] [1x3 double] [1x3 double]
[1x3 double] [1x3 double] [1x3 double]
>> distance
distance =
[1x3 double] [1x3 double] [1x3 double]
[1x3 double] [1x3 double] [1x3 double]
[1x3 double] [1x3 double] [1x3 double]
我需要取成对元素的叉积,即
b = (cross(orient{1,1},distance{1,1}) + cross(orient{1,2},distance{1,2})..... and so on
然后重塑以匹配距离和方向的尺寸。
我可以在不使用 for 循环的情况下执行此操作吗?
如果我有
orient{1,1} =
[1x3 double]
distance =
[1x3 double] [1x3 double] [1x3 double]
[1x3 double] [1x3 double] [1x3 double]
[1x3 double] [1x3 double] [1x3 double]
我该怎么办
sum1 = (cross(orient{1,1},distance{1,1}) + cross(orient{1,1},distance{1,2}) +...) sum2 = (cross(orient{1, 2},distance{1,1}) + cross(orient{1,2},distance{1,2}) +...)
其中每个“和”只是单个方向元素的迭代,与距离的所有元素相交,然后将这些叉积相加。然后我会有:
mastersum = sum1 sum2 sum3
sum4 sum5 sum6
sum6 sum8 sum9
在哪里
sum1 =
[1x3 double]
我只是把它放在一个令人困惑的方式吗?