
Complex surface to plot
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Cezar Axintescu
le 8 Juin 2017
Commenté : Star Strider
le 10 Juin 2017
Hello! I need to make represent the protection surface of a lightning arrester. This means I have a vertical cube(very slim)...height = 7; sides= 0.5; I also have a radius of a circle of about 3.5; I have to intersect these and plot a surface that looks like a circus tent. It should look like the images below (a wizard's hat, if you want). Can anybody help me? Thanks a lot!
<<

>>
0 commentaires
Réponse acceptée
Star Strider
le 8 Juin 2017
I don’t have your function to plot, so I created one. The rest of the code is (I hope) relatively straightforward to understand. I leave it to you to insert the correct structure of the lightning arrestor structure, although you may not need it since the mesh plot will obscure it. Change it as necessary to create the result you want.
The Code —
f = @(b,r) b(1).*exp(-b(2).*r); % Function Of Radius Only
a = linspace(0, 2*pi, 50); % Angle
r = linspace(0, 100, 50); % Radius
b = [30 0.05]; % Parameter Vector
[A,R] = meshgrid(a, r); % Creat Mesh Matrices
fr = f(b,R); % Evaluate Function Of ‘R’ Matrix
[xm,ym,zm] = pol2cart(A,R,fr); % Convert To Cartesian
figure(1)
mesh(xm, ym, zm)
grid on
The Plot —

8 commentaires
Star Strider
le 10 Juin 2017
You need to provide the function you want to use. I know essentially nothing about the physics of lightning arrestors.
The best I can do is a version of the inverse-square law (that seems appropriate here):
f = @(c,r) c*(1./(1 + r/c).^2); % Function Of Radius Only
a = linspace(0, 2*pi, 50); % Angle
r = linspace(0, 100, 50); % Radius
c = 30;
[A,R] = meshgrid(a, r); % Creat Mesh Matrices
fr = f(c,R); % Evaluate Function Of ‘R’ Matrix
[xm,ym,zm] = pol2cart(A,R,fr); % Convert To Cartesian
figure(1)
mesh(xm, ym, zm)
grid on
axis equal
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Properties dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
