How to extend exponential fitted line to extrapolate values

조회 수: 15 (최근 30일)
Daniel Jordan
Daniel Jordan 2021년 12월 7일
댓글: Daniel Jordan 2021년 12월 8일
I made the code below to graph results I got doing some viscosity testing. I want to use the results to predict how much water to add to some paint to get to a given viscosity. I need to extend the line of best fit to the around the 70% mark on the x axis. My knowledge of matlab is pretty basic as you can probably tell.
T = readtable('ViscosityResults.xlsx','Range','L2:M14',... #read spreadsheet and select range
'ReadVariableNames',true,'VariableNamingRule','preserve')...#take headings from file and keep them as they are
figure;
x = T{:,1}
y = T{:,2}
f = fit(x,y,'exp1');
plot(f,x,y)
xlim([0,70])
ylim([0,45])
title('Viscosity of primer by % volume water')
xlabel('% Volume water')
ylabel('Viscosity (cP)')
I just want a matlab graph that basically looks like this, with the extended trendline:

채택된 답변

Matt J
Matt J 2021년 12월 7일
xx=linspace(0,85,500);
plot(xx,f(xx))

추가 답변 (0개)

카테고리

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