Effacer les filtres
Effacer les filtres

plotting sphere and rectangle mesh

22 vues (au cours des 30 derniers jours)
cob
cob le 23 Juin 2015
Modifié(e) : cob le 23 Juin 2015
need help on plotting something like this :
any idea ?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 23 Juin 2015
Modifié(e) : Azzi Abdelmalek le 23 Juin 2015
sphere(20)
axis square
You can get the coordinates x,y and z
[x,y,z]=sphere(20)
You can plot a sphere
surf(x,y,z)
  4 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 23 Juin 2015
Modifié(e) : Azzi Abdelmalek le 23 Juin 2015
ii=-1:0.1:1
jj=-1:0.1:1
[ii1,jj1]=meshgrid(ii,jj)
surf(ii,jj,zeros(size(ii1)))
hold on
sphere(20)
cob
cob le 23 Juin 2015
Modifié(e) : cob le 23 Juin 2015
Thanks a lot , i did a little modification base on your code : x = -2:0.1:2;
y = -2:0.1:2;
[X,Y] = meshgrid(x,y);
surf(x,y,zeros(size(X)),'Facecolor','black');
hold on
sphere(25);
axis square
legend('the square',' the ball of 20','Location','SouthWest');

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by