Этот код представляет график функции g с двумя горизонтальными линиями и одной вертикальной линией:
function y = g(x)
if x < 5 | 50 < x then
error("Out of range");
elseif x <= 11 then
y = -59.535905 + 24.763399 * x - 3.135727 * x^2 + 0.1288967 * x^3;
return;
elseif x <= 12 then
y = 1023.4465 - 270.59543 * x + 23.715076 * x^2 - 0.684764 * x^3;
return;
elseif x <= 17 then
y = -307.31448 + 62.094807 *x - 4.0091108 * x^2 + 0.0853523 * x^3;
return;
else
y = 161.42601 - 20.624104 * x + 0.8567075 * x^2 - 0.0100559 * x^3;
end
endfunction
**//this represents the vertical line**
a=linspace(45,45,60)
b=linspace(0,70,60)
plot(a,b,style='r')
**//this represents the first horizontal line**
a=linspace(0,60,60)
b=linspace(30,30,60)
plot(a,b,style='g')
//this represents the second horizontal line
a=linspace(0,60,60)
b=linspace(40,40,60)
plot(a,b,style='g')
//this is the graph of function "g"
t = [5:50];
plot(t, feval(t, g));
// the part of code is for to find the solution of fsolve
//plot(t, feval(t, g)-30);
//plot(t, feval(t, g)-60);
//deff('[y] = g2(x)', 'y = g(x)-30');
//deff('[y] = g3(x)', 'y = g(x)-40');
Проблема состоит в том, что я хочу найти четыре точки пересечения между кривой и тремя линиямии рассчитать цветную поверхность.и как я могу раскрасить эту область в Scilab, потому что я использовал краску, чтобы лучше объяснить фигуру.и приветствуем любую помощь.
![enter image description here](https://i.stack.imgur.com/ftkRt.png)