MATLAB: I dont know how to solve the below question. I’m completely lost on where to even begin. I understand the fprintf, just the sin and cos always throw me off. Any direction would even be greatly appreciated

MATLAB

For 0 ≤ x ≤ 1 with an increment of 0.1 in x, compute f( x )=sin*x/1+x. For this computation, set x=0:0.1:1 and then perform element-by-element multiplication (.*) operation. Please avoid plugging each x to the function. Using fprintf, print out x and f(x) in two columns with each variable having 8 decimal places.

Best Answer

x=0:0.1:1;
f=sin(x./(1+x));
for i=1:length(x)
fprintf('%0.8f %0.8f\n',x(i),f(i));
end