필터 지우기
필터 지우기

can anyone help me how to do rectangular curve fitting ? which function to use?

조회 수: 8 (최근 30일)
L K
L K 2017년 1월 3일
댓글: dpb 2017년 1월 4일
i have some data points on the graph and i want to fit a rectangular curve around it..
  댓글 수: 3
L K
L K 2017년 1월 4일
please check the image i have attached, the dotted lines around the lines is what i mean by rectangular. Is it possible to do that in matlab?
dpb
dpb 2017년 1월 4일
Of course it is; as the demo I gave shows, you can draw a line or set of lines of any style anywhere you desire on the figure; all you've got to do is have a way to compute or otherwise divine the location of the line segment end points.
There is
doc rectangle
as well...

댓글을 달려면 로그인하십시오.

답변 (1개)

dpb
dpb 2017년 1월 3일
Taking a wild guess, perhaps the following simple demo will help..
N=50; % arbitrary number points
x=randn(N,1); y=randn(size(x)); % and some even more arbitrary data
scatter(x,y,15,'k','filled'); % toss 'em around on an axis
minx=min(x); maxx=max(x);
miny=min(y); maxy=max(y);
pct=0.2; pLo=1-pct; pHi=1+pct; % another arbitrary scaling factor
hL=line([pLo*minx;pHi*maxx;pHi*maxx;pLo*minx;pLo*minx],...
[pLo*miny;pLo*miny;pHi*maxy;pHi*maxy;pHi*miny], ...
'color','r')

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by