Error when taking an exponent from a large data set

조회 수: 5 (최근 30일)
Lev Mihailov
Lev Mihailov 2019년 7월 30일
편집: Lev Mihailov 2019년 7월 30일
Hello! I have a 1x3000 data array, I am trying to take an exponent and it gives me an error
xanimal=[300 3004 1002 4000 5000 2010 2000 ...];
x1=xanimal/200;
x2=exp(x1);
x3=(2 * sin(x2)) - (3.14/3.4)+104.2;
Ansver=x3 *100+ 25.4
Undefined function 'exp' for input arguments of type 'uint32'.
Error in Untitled (line 11207)
x2=exp(x1);
How can I fix this?

답변 (1개)

Stephen23
Stephen23 2019년 7월 30일
x2 = exp(double(x1));
  댓글 수: 3
Stephen23
Stephen23 2019년 7월 30일
편집: Stephen23 2019년 7월 30일
"the wrong result shows..."
As you do not show the "wrong result" or explain anything about them or even show what the right result should be or the code that you are now using, then you force us to guess what you are doing. Guessing is not an effective way to debug code. If you want more help, then you need to show us the exact code that you tried, and also the output that you expect.
"(shows values ​​more than necessary)"
I have no idea what that means. Please explain.
Lev Mihailov
Lev Mihailov 2019년 7월 30일
편집: Lev Mihailov 2019년 7월 30일
I put the double value x2 one value is counted differently when I insert my data array the readings change a little
xanimal=[300 3004 1002 4000 5000 2010 2000 ...];
x1=xanimal/200;
x2 = exp(double(x1));
x3=(2 * sin(x2)) - (3.14/3.4)+104.2;
Ansver=x3 *100+ 25.4
Excuse me! the error was in x1 it gives only one of my value, which is greater than 1 and 2

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

카테고리

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