Info
この質問は閉じられています。 編集または回答するには再度開いてください。
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
grouping vectors based on z value
1 回表示 (過去 30 日間)
古いコメントを表示
Hi guys,
If I have how array of vectors a(xi,to,zi) and b(xj,y2k,zj), I want to extract a new group based on the condition zi=zj. And the cross product the resulted vectors. Thanks
11 件のコメント
Walter Roberson
2020 年 6 月 8 日
For each value in intersect(xi, xj) you have a 2D array a(:,:,I) and b(:,:,J) where zi(I) == zj(J) . How do you want to take the cross-product of the 2D arrays? Also, since there are possibly multiple values that match zi(I) == zj(J), how do you want the resulting 2D arrays to be stored ?
Oday Shahadh
2020 年 6 月 8 日
Walter Roberson
2020 年 6 月 8 日
You do not have vectors, you have points. Your diagram implies that you might be wanting one vector to be implied by the vertical projection to the x axes: is that what you want to do for all of the vectors?
I am unable to find any possible geometric interpretation for taking the cross-product of so many vectors together with each other. Especially since you have no absolute ordering, and cross-product is dependent on the angle but without ordering the angle is not meaningful.
Oday Shahadh
2020 年 6 月 8 日
dear Walter,
they are all a position vectors, I did the cross product for just one point with its center as seen, the result is a vector as produced in the plot, pls check it.
as seen there is cylindrical layers with center point per each, what I need is to make a cross product between the center point of each layer with the related points of the same layer.
I know you are very smart Walter, Thanks
Oday Shahadh
2020 年 6 月 8 日
clc
clear
close all
format long
x=[];
y=[];
z=[];
for L=-2:0.5:2
for r=0:.5:2
for theta=0:45:360;
x=[x;r*cos(theta*pi/180)];
y=[y;r*sin(theta*pi/180)];
z=[z,L];
L1=[x-x,x-x,z'];
end
end
end
lx=L1(:,1);ly=L1(:,2);lz=L1(:,3);
z=z';
p=[x,y,z];
b=cross(L1(1,:),p(1,:));
figure(1)
scatter3(x,y,z);hold on
plot3(lx,ly,lz,'r');hold on
scatter3(b(1),b(2),b(3));hold on
Walter Roberson
2020 年 6 月 8 日
Why does your L1 not involve y?
Your L1 is just two rows of 0 and the third row is L values each repeated length(0:.5:2) * length(0:45:360) times. Why bother to go through that trouble with it? Why not just build it directly with zeros() and repelem() ?
Your cross() is guaranteed to be (0, 0, 0) each time.
Oday Shahadh
2020 年 6 月 8 日
編集済み: Oday Shahadh
2020 年 6 月 8 日
((Why bother to go through that trouble with it?)) Because I am not Walter Roberson.
to create position vector in cylindrical coordinates we need (L) the central position vectorline,(r) the radiuse for each point and(theta) the angle between any two ponits
回答 (0 件)
参考
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)