MATLAB Answers

Plotting a graph through the points

조회 수: 7(최근 30일)
asd ad
asd ad 6 Aug 2020
댓글: asd ad 7 Aug 2020
Hello everyone,
I have collected this experimental data from the lab where x is time with 1 being 1 second 70 being 70 seconds and so on. I want the reading in y as points in which a curve can go through. Furthermore, I would like to insert this line into the same graph as my model. How do I do this? I have attached my code below for the plotting from the model.
x = [1 70 140 210 280 350 420 490 560 630 696]
y = [65.08 60.7 55.83 50.43 44.56 38.55 31.98 25.43 18.68 11.11 0]
figure (2)
grid on
xlabel ('Time (s)')
ylabel ('\theta (\circ)')
title ('Contact Angle vs Evaporation Time')
Thanks in advance for the help.

  댓글 수: 0

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

채택된 답변

dpb 6 Aug 2020
편집: dpb 6 Aug 2020
hold on
The quadratic seems to do a very nice job -- of course, don't even try to use it to extrapolate more than a very, tiny, tiny, amount.

  댓글 수: 1

asd ad
asd ad 7 Aug 2020
Thank you. It worked

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

추가 답변(1개)

Sudheer Bhimireddy
Sudheer Bhimireddy 6 Aug 2020
You mean fitting a curve or polynomial function through the points?
Read: polyfit and you can modify the examples given there to your case.

  댓글 수: 0

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

Community Treasure Hunt

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

Start Hunting!

Translated by