plotting two curves together in only one figure for different intervals

2 次查看(过去 30 天)
There are two mathematical functions in below:
y=-0.6729+4.8266x-0.4855x^2+0.0312x^3 from x=0 to x=33.5
y=-486.39+151.64Ln(x) from x=33.5 t0 45
Please help me, how can I plot these together in MATLAB?

采纳的回答

Friedrich
Friedrich 2012-2-13
Hi,
maybe like this:
y_1 = @(x) -0.6729+4.8266*x-0.4855*x.^2+0.0312*x.^3
y_2 = @(x) -486.39+151.64*log(x)
x_1 = 0:0.1:33.5;
x_2 = 33.5:0.1:45;
plot(x_1,y_1(x_1),'b',x_2,y_2(x_2),'b')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by