フィルターのクリア

Shaded plot on a parametric surface (cylinder)

2 ビュー (過去 30 日間)
Rollo
Rollo 2015 年 2 月 14 日
コメント済み: John D'Errico 2015 年 2 月 14 日
Hello everyone! I have measured the magnetic field around the outside of a cylinder, at a constant radius. I am using MATLAB to process the data and have created 2D imagesc plots of the field intensity as a function of the axial and angular position. I would like to plot this data on the surface of a cylinder that represents the cylindrical surface that I am measuring on, how would I achieve this?
Example data: Z = 40x1 double from 0 to 1m
angle = 18x1 double from 0 to 2pi
Field = 18x40 double
Graph in 2D:
I now want to visualise this in 3D on the surface of a cylinder at constant R.
Thanks for your help!

採用された回答

John D'Errico
John D'Errico 2015 年 2 月 14 日
編集済み: John D'Errico 2015 年 2 月 14 日
You plotted an array in terms of cylindrical coordinates, where one of the axis variables was angle. Convert that angle to cartesian coordinates. If you don't know how to do that, at the least you can use pol2cart as long as you know the radius.
help pol2cart
This will give you xyz coordinates for that surface. now surf will do nicely, or you can use patch.
help patch

その他の回答 (1 件)

Rollo
Rollo 2015 年 2 月 14 日
Thanks John, I knew it would be something simple, I'll give this a go
  1 件のコメント
John D'Errico
John D'Errico 2015 年 2 月 14 日
I recall you will want to use a form like
surf(X,Y,Z,C)
where C is the mapping you use to determine the colors on that surface. X and Y come from the polar conversion of course. And if your cylinder is at some more general angle, then this is still only a linear transformation of X,Y,Z.

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by