Programming Lab
Programming Lab
number = 16;:
Assigns the value 16 to number.
sqrt_result = sqrt(number);:
The sqrt function calculates the square root of number.
fprintf(...);:
Outputs the square root of the number. %f is used for the floating-point result.
% Natural Logarithm
number = 10;
log_result = log(number);
fprintf('The natural logarithm of %d is %f\n', number, log_result);
% Display the result result = numerator / denominator;: This divides the numerator
fprintf('The result of 2^5/((2^5) - 1) is %f\n', result); by the denominator and stores the result
load balldata.mat
time = balldata(:,1)
height = balldata(:,2)
plot(time, height)
yline(0);
xlabel('Time (s)')
ylabel('Height (m)')
Thank You