error "Undefined function 'atan2' for input arguments of type cell"

6 visualizaciones (últimos 30 días)
I want to calculate ATAN(X,Y) where X=data(:,2); and Y=data(:,3); from a CSV file. The output of X is 1801X1 cell and Y is 1801X1 cell. please let me know how to convert the values of X and Y to calculate ATAN

Respuesta aceptada

Walter Roberson
Walter Roberson el 31 de Mayo de 2016
RotAngle = data{2};
Bx = data{4};
Bz = data{5};
  2 comentarios
Krishna Pradeep Gollamahanti
Krishna Pradeep Gollamahanti el 31 de Mayo de 2016
Editada: Walter Roberson el 31 de Mayo de 2016
Now i can see the data of Bx and Bz with the below error
Bx=data{4};
Bz=data{5};
Angle=atan2(Bx,Bz)/pi()*180;
Undefined function 'atan2' for input arguments of type 'cell'.
Walter Roberson
Walter Roberson el 31 de Mayo de 2016
Sorry, I did not read your code properly.
What you want to do cannot be done. It is not possible to calculate the arctan of a string. But if you ever encounter a file that has numbers in columns then you could textscan using a numeric format and then use the method I showed.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Standard File Formats en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by