Extract output data from meshgrid input
古いコメントを表示
I have some data which I have interpolated as follows:
Data = load("data.txt")
x = Data(:,1);
y = Data(:,2);
z = Data(:,3);z=-z;
c = Data(:,4);
F = scatteredInterpolant(x,y,z,c);
N = 50;
xvec = linspace(min(x), max(x), N);
yvec = linspace(min(y), max(y), N);
zvec = linspace(min(z), max(z), N);
[xq, yq, zq] = meshgrid(xvec, yvec, zvec);
vq = F(xq, yq, zq);
What I want to do is to extract the value of vq for a given xq,yq,zq.
Like vq(xq==21.7267 & yq==36.9072 & zq==-0.9551), which gives me an empty column vector.
If I do F(21.7267,36.9072,-0.9551) is this the correct vq?
採用された回答
その他の回答 (1 件)
Walter Roberson
2021 年 2 月 14 日
vq(xq==2 & yq==3 & zq==5)
3 件のコメント
Walter Roberson
2021 年 2 月 14 日
better yet is ismembertol instead of ==
tandemuse
2021 年 2 月 14 日
Walter Roberson
2021 年 2 月 14 日
That why I said to use ismembertol()
カテゴリ
ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!