Question: % Please enter your name inside the single quotes in the next line name = 'Asim, Rayyan'; % Last Name, First Name nameInfo = isempty

% Please enter your name inside the single quotes in the next line
name = 'Asim, Rayyan'; % Last Name, First Name
nameInfo = isempty(name);
if (nameInfo==1)
disp('Please enter your name in Line 2.');
end;
% Define unknowns and integration variables as symbolic variables
syms c s v; % Unknowns
syms ; % integration variables
nbrSymvar = length(whos);
% Given
a = c*s ; %[m/s^2]
v0=0;
s0=1.5; %[m]
s1=3; %[m]
v1=200; %[m/s]
% Solve
eqn = v*diff(v,s)== a ; % Define the equation
slv = dsolve(eqn,v(s0)==v0); % Solve the equation
% Display
disp('You should get: The value of constant c is 28853.90 m^2/s^2.');
fprintf('The value of constant c is %.2f m^2/s^2.
',c); % Keep the two digit places
fprintf('
');
disp('You should get: The value of constant c is 2.89e+04 m^2/s^2.');
fprintf('The value of constant c is %.3g m^2/s^2.
',c); % Keep three significant digits
disp('Did you notice the difference between %f and %g?');

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!