Create a MATLAB script called WeightConv that will convert a
Create a MATLAB script called Weight_Conv that will convert any input mass to the corresponding weight on each of the 8 planets (if you still like Pluto, you may use 9).
The script should request a value for MASS and then converted and output the corresponding weight on each the planets starting with Mercury moving outward
Solution
m=input(\'enter the mass in kg \');
planet=[\"mercury\";\"venus\";\"earth\";\"mars\";\"jupiter\";\"saturn\";\"uranus\";\"neptune\"];
planet=cellstr(planet);
g=[3.61 8.83 9.8 3.75 26.0 11.2 10.5 13.3 ];
weight=m*g;
for i=1:8
table(i,1)=planet(i);
end
for i=1:8
str=[\'weight on \',planet{i},\' is \',num2str(weight(i))];
disp(str)
end
