finding (x,y) points for each Z

6 ビュー (過去 30 日間)
Bas Bloemendaal
Bas Bloemendaal 2020 年 5 月 20 日
回答済み: Ameer Hamza 2020 年 5 月 20 日
Hi there,
I'm plotting all my values of the magnitude (in Tesla) of an induced magnetic field against a meshgrid which are the distances.
What I need to know are the distances (x,y) for all magnitudes of my field, but I can't link them togehter. Does someone know how to
acces these values for each z value ?
Thanksin advance
R = linspace(-0.04,0.04,N); % target points [m]
Z = linspace(0.001,0.04,N); % target points [m]
[R2,Z2] = meshgrid(R,Z);
[Br,Bz] = soleno_calcB(R2,Z2,Rin,Rout,Zlow,Zhigh,Itot,Nloop);
surf(R2,Z2,Bz);
title('Induced Magnetic field of detection coil')
xlabel('lateral distance [m]')
ylabel('axial distance [m]')
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 20 日
Do I understand correctly, that you want to find the unique() Bz values, and for each one, construct a list of (R, Z) pairs that give that exact Bz value? So a list of Bz values, and a cell array of [R,Z] for each of those ?

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 20 日
Bz, R2, and Z2 are already 2D matrices of the same size, so their corresponding values lie at the same index. For example, Bz(i,j) corresponds to R2(i,j) and Z2(i,j). However, If you want to have a linear list then do something like this
B = Bz(:);
RZ = [R2(:) Z2(:)]

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by