Hi Every One
1- Suppose We Have 1.7321 . Which Command returns the non-numerical value? (I mean sqrt(3) )
2-Run This
% Interactive script to fit a cubic to data points
clf;clc;clear all;grid onhold onaxis([0 100 0 100]);diff = 10;xold = 68;i = 0;xp = zeros(1); % data points
yp = zeros(1);while diff > 2[a b] = ginput(1);diff = abs(a - xold);if diff > 2i = i + 1;xp(i) = a;yp(i) = b;xold = a;plot(a, b, 'k*')endendp = polyfit(xp, yp, 3 );plotfunction=poly2sym((p))x = 0:0.1:xp(length(xp));y=p(1)*x.^3 + p(2)*x.^2 + p(3)*x + p(4);plot(x,y), title( 'cubic polynomial fit'), ...ylabel('y(x)'), xlabel('x')hold off end
The Output has a large amount of number… how can i simplify it???
Best Answer