필터 지우기
필터 지우기

To resample a 3D-mesh grid

조회 수: 7 (최근 30일)
Ampi
Ampi 2013년 2월 6일
Hello everybody,
I am trying to implement the following code to re-sample a 3D mesh-grid but it is giving me errors:
[x1,y1] = meshgrid(min(x):xstep:max(x), min(y):ystep:max(y));
gridsize=size(x1);
% y1=max(y1(:))-y1;
% z1= griddata(x,y,z,x1,y1); %#ok<GRIDD>
% y1=max(y1(:))-y1;
F = TriScatteredInterp(dt,z1);
xi = reshape(x1,gridsize );
yi = reshape(y1,gridsize );
zi = reshape(z1,gridsize );
figure(1),mesh(xi,yi,zi);
////////Errors are given on xi=reshape(x1,gridsize); Please help me out in this problem.
  댓글 수: 1
Youssef  Khmou
Youssef Khmou 2013년 2월 6일
hi, Do you mean that you want increase the isosamples ? if that so, you can not use reshape, because the number of elements must not change .

댓글을 달려면 로그인하십시오.

답변 (2개)

Youssef  Khmou
Youssef Khmou 2013년 2월 6일
Your code is incomplete, z is missing, repost .

Image Analyst
Image Analyst 2013년 2월 6일
This is a 2D situation, not 3D. You have two independent variables, x and y, and a dependent variable, z, at each x,y location.
Your calculation of zi is bogus. For one reason, z1 is commented out.
  댓글 수: 1
Youssef  Khmou
Youssef Khmou 2013년 2월 6일
hi, even with z1 not commented, there no variable z as an input of griddata func

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by