In an assignment A(I) = B, the number of elements in B and I must be the same. Error in odev_3_c (line 9) fprime(1)=x.*cos(3*x); >>
Show older comments
clc
clear
format long
x=0:1:4;
fg=x.*(cos(3*x));
% 6 anlamlı basamak için hesaplama
fprime(1)=x.*cos(3*x);
fprime(2)=-6*sin(3*x)-9*x.cos(3*x);
fprime(3)=-27*cos(3*x)+27*x.*sin(3*x);
fprime(4)=108*sin(3*x)+81*x.cos(3*x);
fprime(5)=405*cos(3*x)-243*x.*sin(3*x);
fs1=0;
for i=1:5
fs1=fs1+fprime(i)*x^{i-1}/factorial(i-1);
%bağıl hata hesaplama
if abs((fg-fs1)/fg)<0.5*1e-5
disp('gercek değer:')
fg,
disp('aranan yaklaşık değer:')
fs1,
disp('iterasyon sayısı')
i,
break
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Multicore Processor Targets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!