Contour plot of stresses in a beam
30 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (2 件)
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 件のコメント
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().
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!