This is amy code it is not working why?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
x=[1 4 5 7.5 14 21 23 32]
v=x.^(2) * exp.(x) + x * (( x + log(x)).^(1/2))
댓글 수: 1
답변 (2개)
madhan ravi
2018년 9월 13일
편집: madhan ravi
2018년 9월 13일
x=[1 4 5 7.5 14 21 23 32]
v=x.^(2).*exp(x)+x.*((x+log(x)).^(1/2))
v=vpa(v)
댓글 수: 3
Rik
2018년 9월 13일
The explanation for answer is this: your code uses matrix multiplications. If you want element-wise operation, you should use the dot-version. This is for * / and ^.
madhan ravi
2018년 9월 13일
편집: madhan ravi
2018년 9월 13일
Exactly as Rik Wisselink mentioned element wise operation should be used since your x is a vector
madhan ravi
2018년 9월 13일
If it solved the problem please accept the answer.
The problem is the dot after exp that shouldn't be there and the missing dots before the two *
% v----------- problem was here
v=x.^(2) .* exp(x) + x .* (( x + log(x)).^(1/2))
% ^------------^------ and here
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!