Surf circumferences with borders

1 回表示 (過去 30 日間)
eddie
eddie 2017 年 7 月 17 日
コメント済み: eddie 2017 年 7 月 17 日
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

回答 (1 件)

KSSV
KSSV 2017 年 7 月 17 日
h1 = surf(X,Y,Z) ;
set(h1,'edgecolor','k')
  1 件のコメント
eddie
eddie 2017 年 7 月 17 日

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?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by