How do I plot data from a matrix where column=r and row=theta?

조회 수: 2 (최근 30일)
Thomas Edwards
Thomas Edwards 2013년 3월 14일
I'm trying to figure out how to do a surface polar plot of my data. I have a 36*36 matrix of data points, where the row index of the matrix corresponds to r and the column index corresponds to angle (theta=0 to 360 degrees in steps of 10).
How would I go about plotting this data? I've googled many things but I've had no luck.
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2013년 3월 14일
rvals = [.....] %the list of r values corresponding to row
thdegvals = [.....] %the list of theta values corresponding to column
thradvals = thedegvals .* (pi ./ 180);
[xvals, yvals] = pol2cart(thradvals, rvals);
surf(xvals, yvals, MatrixOfValues);

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by