필터 지우기
필터 지우기

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?

조회 수: 1 (최근 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
Azriel Faiz Abu Fadzil
Azriel Faiz Abu Fadzil 2017년 11월 2일
My answer look like this E =
1.0e+34 *
Columns 1 through 16
8.0773 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Columns 17 through 32
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Columns 33 through 48
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Columns 49 through 50
Inf Inf

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by