How to take an exponential to a non-integer value?

kvals = [0.142,0.144,0.156,0.180,0.196,0.205,0.207,0.201,0.177,0.160,0.149,0.142] ;
upx = -K./sinalpha_angle
exp_local = exp(upx)
I am trying to take an exponent of a non-integer value (upx) and keep getting the error that "Array indices must be positive integers or logical values". I know that none of these values are an integer but need to take the exponential to the non-integer power.
Any help is appreciated.

 채택된 답변

Voss
Voss 2022년 12월 10일

1 개 추천

It may be that the error is about trying to index a variable called exp with invalid values. Do you have a variable called exp? If so, change it to something else, and if this is a script do clear exp before you run it again.

댓글 수: 2

Ryan
Ryan 2022년 12월 10일
Somewhere I must have created that at some point. Thank you for pointing out my fault.
Voss
Voss 2022년 12월 10일
You're welcome!

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

추가 답변 (1개)

Matt J
Matt J 2022년 12월 10일

1 개 추천

You have created a variable named "exp" prior to the code you've shown. It needs to be cleared.

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

질문:

2022년 12월 10일

댓글:

2022년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by