필터 지우기
필터 지우기

contour diagram with three vectors

조회 수: 4 (최근 30일)
mads skibsted
mads skibsted 2024년 4월 17일
편집: Aquatris 2024년 4월 17일
I need to make a contour diagram. And it consist of three vectors with x-coordiantes, y-coordinates and then the related stresses to each point.
For example:
1....Nodal_coordinate_x....nodal_coordinate_y.....stress_value
2..........0..................................10.......................150
3..........1..................................10 ......................200
4..........1..................................0........................100
Do you know how I can do this? So it could end up looking like this: where I have plottet all the coordinates and then related the stresses to each point showing the contour colours where the stresses are small/larger?

채택된 답변

Aquatris
Aquatris 2024년 4월 17일
편집: Aquatris 2024년 4월 17일
Here is one way:
x = linspace(0,4,10); % x coordinate
y = linspace(0,8,10); %^y coordinate
[X,Y] = meshgrid(x,y); % meshgrid
Z = sin(X)+cos(Y); % Z data, the stresses for X-Y coordinates
c = Z(:); % colors for scatter plot, make it a vector since scatter plot expect vectors
% actual plot
scatter(X(:),Y(:),[],c )
axis([-1 5 -1 9])
Here is another using actual contour plot:
contourf(X,Y,Z)

추가 답변 (0개)

카테고리

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