MATLAB: How do i use function files to solve these equations. The values of x and y remain the same but t changes. Sorry for the poor format..

solve

t = 18.000
x0 = 0.240770;
x1 = 0.5332154;
x2 = -0.0000532;
x3 = -0.0000085;
x = (x0) + x1*t + x2*(t^2) + x3*(t^3);
y0 = 0.124136;
y1 = -0.2388140;
y2 = -0.0000965;
y3 = 0.00000042;
y = (y0) + y1*t + y2*(t^2) + x3*(t^3);

Best Answer

function [x, y] = do_my_assignment(t)
x0 = 0.240770;
x1 = 0.5332154;
x2 = -0.0000532;
x3 = -0.0000085;
Fx = @(t) (x0) + x1*t + x2*(t.^2) + x3*(t.^3);
y0 = 0.124136;
y1 = -0.2388140;
y2 = -0.0000965;
y3 = 0.00000042;
Fy = @(t) (y0) + y1*t + y2*(t.^2) + x3*(t.^3);
x = Fx(t);
y = Fy(t);