contour map for stress distribution
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to plot a contour map. It relates to stress distribution of a circular area. My trial as follows:
X =linspace(-4.5,4.5);
R=linspace(-4.5,4.5) ;
[X,Y] = meshgrid(X,Y);
Z= 3426.8/63.3+660*X*4/3.14/4.5^4+1700*sqrt(R^2-X^2)*4/3.14/4.5^4;
contourf(X,Y,Z)
Q1) How can i obtain continuous contour and its scale
0 Kommentare
Antworten (2)
Sulaymon Eshkabilov
am 31 Mai 2021
HI,
Here is a corrected code:
X =linspace(-4.5,4.5);
R=linspace(-4.5,4.5) ;
[X,Y] = meshgrid(X,R);
Z= 3426.8/63.3+660*X*4/3.14/4.5^4+1700*sqrt(Y.^2-X.^2)*4/3.14/4.5^4;
contour3(X,Y,abs(Z))
0 Kommentare
DGM
am 31 Mai 2021
Bearbeitet: DGM
am 31 Mai 2021
I don't know what you're doing, but this at least runs:
X = linspace(-4.5,4.5);
R = linspace(-4.5,4.5);
[X,Y] = meshgrid(X,R);
Z = 3426.8/63.3 + 660*X*4/3.14/4.5^4 + 1700*sqrt(Y.^2-X.^2)*4/3.14/4.5^4;
numlevels = 20; % set to whatever you want
contourf(X,Y,abs(Z),numlevels,'edgecolor','none')
I doubt that's what you want, but it's what I could guess from what you wrote. If you figure out what you're trying to plot, you can use contourf() with however many levels you want to get more Z-resolution. At some point though, it stops being useful as a contour map. Otherwise, you can just display Z using imagesc().
EDIT:
I decided to adopt Sulaymon's interpretation of intent. That makes a bit more sense.
2 Kommentare
DGM
am 31 Mai 2021
That still doesn't make sense. You have a plot that's R on one axis and X on the other. As far as your coordinate setup indicates, you have a sectional plot. Like I said. I doubt it's what you want, but it's what you wrote. I don't know how you want to make this into something else.
If you can represent your information in polar coordinates, you could do something like this:
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!