-2
如何在Matlab中找到構成任何半徑圓的邊的點矩陣?如果我繪製這些點,我應該接近一個圓圈(儘管一個光滑的圓圈由無數個點組成)。Matlab - 圓點上的點矩陣
如何在Matlab中找到構成任何半徑圓的邊的點矩陣?如果我繪製這些點,我應該接近一個圓圈(儘管一個光滑的圓圈由無數個點組成)。Matlab - 圓點上的點矩陣
radius = 5; %desired radius
numPoints = 1000; %Number of points in your circle
angles = linspace(0,2*pi,numPoints)'; %Angles evenly spread around the circle, from 0 to 2*pi radians
xyCircle = radius*[cos(angles) sin(angles)]; %This is the matrix you probably want
plot(xyCircle(:,1), xyCircle(:,2),'.'); %Quick plot to check the result
axis equal;
您是否試過Google?以下是第一個搜索結果中的一個:http://www.mathworks.com/support/solutions/en/data/1-15I2I/ –
感謝您的回覆,我會嘗試一下,我需要矩陣中的所有點我需要解決更大的Matlab問題。 – Esther
這是很基本的MATLAB。我建議你在繼續處理更高級的問題之前先熟悉MATLAB的基礎知識。如果遇到特定問題,請發佈問題。無論如何,祝你好運,歡迎來到StackOverflow! –