Contour plot of stresses in a beam

30 次查看(过去 30 天)
Nikola
Nikola 2011-11-10
Hello,
could someone please help me with my problem, I am still a beginner in using MatLAB. I have a set od stress values in a beam. Each stress value is computed at a specific point with it's coordinates x and y. What I want is to plot a contour plot of the stresses in the beam, where the exact stress is located at point (x,y) in the beam. So, basically I have 3 vectors with 2 of them being the x and y coordinates and the third being the value at the point. I need to plot a contour plot with this data. Any help would be appreciated.

回答(2 个)

Fangjun Jiang
Fangjun Jiang 2011-11-10
You can use the TriScatteredInterp function. Just replace mesh() with contour() in the example provided.
x = rand(100,1)*4-2;
y = rand(100,1)*4-2;
z = x.*exp(-x.^2-y.^2);
F = TriScatteredInterp(x,y,z);
ti = -2:.25:2;
[qx,qy] = meshgrid(ti,ti);
qz = F(qx,qy);
figure(1);scatter3(x,y,z);
hold on;
mesh(qx,qy,qz);
figure(2);
contour(qx,qy,qz);
  2 个评论
Nikola
Nikola 2011-11-11
Did not help, I still can't do a contour plot!
Fangjun Jiang
Fangjun Jiang 2011-11-11
In the example provided, x,y and z are similar to yours. They are just three vectors indicating the coordinates and the z value. After some processing, you can generate the needed data and run contour().

请先登录,再进行评论。


Vishal Jangid
Vishal Jangid 2018-2-11
bhai 2018 ho gaya still no progress!

类别

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