문제

I'm doing my homework and i am calculating linear interpolations for some points. Well i do this with a linear system and solving this.s But when i have the result, a vector with te cofficients, i don't know how can i plot it. Somebody know some way? This is an exemple i want plot R

A = [1 1 1; 4 2 1; 16 4 1]; B = [0; 2; 12]; R = linsolve(A,B); T = 9*R(1) + 3 * R(2) + R(3)

The first thing i have thinked is write a function but has matlab a expecific function?

도움이 되었습니까?

해결책

You can use the ezplot function of matlab. I'm not sure about what you need, so I hope this will help. You have the coefficients so just get the function and pass it to the function ezplot. Something like this :

UPDATE :

func = "";
for k=1:length(R)
 func = func + x^k;
end

And then :

 ezplot(R);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top