フィルターのクリア

ExB drift velocity code equation

6 ビュー (過去 30 日間)
Cesar Cardenas
Cesar Cardenas 2023 年 9 月 27 日
回答済み: John D'Errico 2023 年 9 月 27 日
Hello, I would like to know if there is a better or more elegant way to code this equation and how I could get a better result? Not really sure. Any help will be appreciated. Thanks.
E = 0.1;
B = 20;
E = [0 0.1 0];
B = [0 0 20];
VE = cross(E,B)./B.^2
VE = 1×3
Inf NaN 0

回答 (1 件)

John D'Errico
John D'Errico 2023 年 9 月 27 日
I might guess that what you really want is to divide by the square of the norm of B. NOT by the elements of B squared.
E = 0.1;
B = 20;
E = [0 0.1 0];
B = [0 0 20];
VE = cross(E,B)./norm(B)^2
VE = 1×3
0.0050 0 0

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by