フィルターのクリア

How to interpolate a 3d surface with the different size of squares?

4 ビュー (過去 30 日間)
Nilly
Nilly 2020 年 10 月 6 日
I have a surface between a range -5 to 5 on both x and y axis. I would like to interpolate this surface with a new meshgrid data which has different size for each iteration. However, I cannot get the entire surface with interpolated new data. I only get the different size of squares. Is there a way to interpolate the original surface with different grid spacing ? Here is my code as well. Figure 1 is my original surface. and Figure 4 is interpolated surface which is missing the original surface itself. What I would like to have is Figure 4 in Figure 1.
L1 = 4;
L2 = 3;
L1 = L1;
[xP,yP] = meshgrid(n1:n2);
zP = real( L3*sqrt(1-((xP.^2)/ (L1^2)) - ((yP.^2)./ (L2^2))));
for i =1:length(CoordsX(:,1))
sqx=[min(CoordsX(i,:)), max(CoordsX(i,:))] ;
sqy=[min(CoordsY(i,:)), max(CoordsY(i,:))];
[x,y,z] =rotation(180-alpha,xP,yP,zP);
[Xq,Yq] = meshgrid(sqx,sqy);
Vq = interp2(xP,yP,z+z0_el,Xq,Yq,'cubic');
surf(Xq,Yq,Vq)
hold on
daspect([1 1 1])
end
  3 件のコメント
Nilly
Nilly 2020 年 10 月 6 日
編集済み: Nilly 2020 年 10 月 6 日
sorry. n1 = -5 , n2= 5
z0_el = 6;
Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020 年 10 月 6 日
The lower an upper limits of sqx and sqy are less than the original limits of xP and yP. So, you miss some data points.

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

回答 (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