Surf circumferences with borders

5 vues (au cours des 30 derniers jours)
eddie
eddie le 17 Juil 2017
Commenté : eddie le 17 Juil 2017
Hi all, I want to surf a set of base, where I use a circumference to represent it. So, the script I wrote is:
clear all, close all, clc;
%%Input
Data=[0.671 1.000 0.388 0.860 0.863;...
0.782 0.745 0.453 1.000 0.999;...
0.782 0.642 0.453 1.000 0.997;...
0.781 0.568 0.453 1.000 0.995;...
0.781 0.510 0.452 1.000 0.994;...
0.780 0.466 0.452 1.000 0.992;...
0.780 0.434 0.452 1.000 0.990;...
0.779 0.367 0.451 1.000 0.987;...
0.774 0.228 0.449 1.000 0.972;...
0.780 0.455 0.452 1.000 0.991];
A=Data;
for i=1:size(A,1)
B{i}=repmat(A(i,:)',1,360/size(A,1));
end
B=cell2mat(B);
B=[B;ones(1,size(B,2))];
grados=360;
gra=pi/180;
Lx=210;
[t_elip,r_elip]=meshgrid(linspace(0,grados*gra,grados),linspace(0,Lx,6));
[x_elip,y_elip]=pol2cart(t_elip,r_elip);
X=x_elip;
Y=y_elip;
Z=B;
h1=figure;
surf(X,Y,Z),view([-360 90]),colorbar,xlim([-210 210]),ylim([-210 210]);
axis off;
After I compile this, I get the following figure:
but I want to get this with borders, as this figure:
What should I do? Thanks in advance

Réponses (1)

KSSV
KSSV le 17 Juil 2017
h1 = surf(X,Y,Z) ;
set(h1,'edgecolor','k')
  1 commentaire
eddie
eddie le 17 Juil 2017

Thanks KSSV, but I get this figure:

As you can see I have divisions each 1 grad. What I want to do, is to have divisions each 36 grad, because the whole circumference is divided by 10 sections. I want to get a Figure as I attached before, no divided by 1 grad but by 36 grad. What should I do?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by