필터 지우기
필터 지우기

Matlab sub-plotting with curve fitting

조회 수: 8 (최근 30일)
Maeve  Ryan
Maeve Ryan 2011년 12월 4일
댓글: kk 2014년 8월 15일
Hello,
I have created subplots and I am attempting fit a linear curve to each of the subplots. However, matlab only allows me to fit a curve to one plot and when I try to fit a curve to the second curve, the curve on the first disappears. The version of matlab I have is R2010a.
Can anyone help?
Thanks in advance
  댓글 수: 1
lclk psdk
lclk psdk 2014년 4월 15일
hi sir,have you found an answer ?

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

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 12월 4일
Curve fitting has nothing to do with sub-plotting. I am not sure if you are using subplot() or you mean different curves in the same axes.
If you want to plot multiple curves in the same axes, you can use "hold on". If you use subplot(), you can use axes(h) to activate whatever axes you choose to work on.
Showing your code would be the best way to explain the problem.
  댓글 수: 1
kk
kk 2014년 8월 15일
I think the problem is when you use the fitting tool to draw fitting line after the subplot is created. The tool allows to select a particular data and then draws the fitting line but the previous fitting line is cleared. So you can see only one fitting line. It also says in the toolbox help.
Solution: Create a fitting for one graph and then generate the code and use the generated function to fit on sub plots.

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

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by