contour plots on a given geometry - finite element

조회 수: 2 (최근 30일)
Federica
Federica 2024년 6월 7일
댓글: Mathieu NOE 2024년 6월 10일
I have some values of stretch that I need to assign to a given set of elements and then I want to show a contour plot of those values on the geometry that I get by plotting the elements through the nodes. How can I do?
  댓글 수: 3
Federica
Federica 2024년 6월 8일
I have n-values for stretch and n corresponding centroids to assign that value. how can I create a contour plot?
Mathieu NOE
Mathieu NOE 2024년 6월 10일
can you share the data ?

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

답변 (1개)

Arun
Arun 2024년 6월 10일
편집: Arun 2024년 6월 10일
Hi Federica,
I understand that you have n-values for both stretch and corresponding centroids and wish to create a contour plot for the available data.
Following steps might be useful to achieve the required plot:
  1. Create a grid that covers the range of the centroid coordinates:
[X, Y] = meshgrid(centroid(x),centroid(y));
2. Create the Contour Plot using “contour” function:
contour(X, Y, corresponding values);
Here is an example code for plotting contour plot:
centroid = [linspace(-2*pi,2*pi); linspace(0,4*pi)]';
[X1,Y1] = meshgrid(centroid(:,1),centroid(:,2));
stretch = sin(X1)+ cos(Y1);
contour(X1,Y1,stretch)
For more information related to contour plot please refer the shared MATLAB documentation link: https://www.mathworks.com/help/matlab/ref/contour.html
Hope this helps.

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by