Plotting irregular finite element data in matlab/octave

I am solving a 2D finite element problem and I got x,y,z vectors. The length of these vectors are the number of nodes in my problem. To use the function “mesh”, we need to have x and y coming from “meshgrid”. To plot these data, use the following:

[xi,yi]=meshgrid(x,y);
zi=griddata(x,y,z,xi,yi);
mesh(xi,yi,zi);

Note that xi,yi, and zi are now a matrix.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: