![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/325561/image.png)
How to divide a graph into 8 equal region and assign a number for each region?
조회 수: 2 (최근 30일)
이전 댓글 표시
I am working with border irregularity. For this I have got upto this curve:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/324952/image.bmp)
Now I want to divide it into 8 regions like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/324955/image.bmp)
and for every region I want to assign value=1 so that if the region got minimum 1 star then the value will be 1 and if not then 0. then I wiil add the the number so the range of the result will be 0-8. How can I do this.My code and main image is given below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/324958/image.bmp)
댓글 수: 0
답변 (1개)
darova
2020년 7월 2일
Here is the start
x = 0:.2:20;
x = [x'; nan]; % add 'NaN' to break the line
y = sin(x);
c = round( (1:length(x))/length(x)*5+1 );
cla
patch(x,y,c,'facecolor','none',...
'edgecolor','flat',...
'marker','.')
axis equal
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/325561/image.png)
I didn't understand how you want to apply this to your image. Can you explain?
댓글 수: 6
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Scene Control에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!