HI.I need to find the energy corresponding to masses from 1 kg to 10^6 kg and need to use the logspace function to create an appropriate mass vector. i try make and ue the code below but i failed. can u help me tell which step is wrong?
2 次查看(过去 30 天)
显示 更早的评论
Function used:
function output=energy(m,c)
output=(m*c^2);
end
c=2.9979*10^8;%speed of light in vacuum in metre per second
m=logspace(1,10^6);%mass in kg
E=energy(m,c^2);
2 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!