# Advanced MATLAB: Surface plot of nonuniform data 33

Posted by **Doug Hull**,

**Category:**- Format: PodCast,
- Format: Video,
- Level: Advanced

## 33 CommentsOldest to Newest

**1**of 33

**2**of 33

**3**of 33

**4**of 33

**5**of 33

**6**of 33

**7**of 33

**8**of 33

**9**of 33

**10**of 33

**11**of 33

**12**of 33

**13**of 33

**14**of 33

**15**of 33

**16**of 33

**17**of 33

**18**of 33

**19**of 33

**20**of 33

**21**of 33

**22**of 33

**23**of 33

nx = 5000; % Number of x steps ny = 5000; % Number of y steps n = 100; % Time step x1 = Wzx(:,1); % X-coordinate nodes' y1 = Wzx(:,2); % Y-coordinate nodes' z1 = Wzx(:,n); % Wzx values a t=n*dt % X,Y for regular mesh xlin = linspace(0,8,nx); ylin = linspace(0,3.2,nx); F = TriScatteredInterp(x1,y1,z1); % Interpolant z = zeros(nx,ny); % Matrix declaration % Matrix's filling for i=1:nx-1 for j=1:ny-1 % For each regular coordinate i,j we evaluate Wzx using the % interpolant z(i,j)= F(xlin(i),ylin(j)); end end % Compute the contour matrix for isoline 0 C = contourc(z,[0 0]);What I'm trying to do is to obtain the coordinates (x,y) of the isoline Wzx(x,y) = 0. Thus, I interpolate my data on a regular mesh in order to use contourc function which enables me to find 0 isoline. But my results are not good. Does my code sound sensible ? Thank you, Thibaud

**24**of 33

**25**of 33

**26**of 33

**27**of 33

**28**of 33

**29**of 33

**30**of 33

**31**of 33

**32**of 33

**33**of 33

## Recent Comments