Azzera filtri
Azzera filtri

How to compute the speed from the following dat file

1 visualizzazione (ultimi 30 giorni)
JD_PM
JD_PM il 19 Mag 2022
Commentato: JD_PM il 19 Mag 2022
I want to compute the magnitude of the velocity;data file: surfaceFieldValue1eNEG06.dat https://drive.google.com/drive/folders/1CgeDuCahVZvLXXkNkGWlPg8lSGyurmI3
I run the following code
A = readtable("surfaceFieldValue1eNEG06.dat");
Ux_8 = A{:,"areaAverage_rho_"};
Uy_8 = A{:,"areaAverage_U_"};
Uz_8 = A{:,"areaAverage_p_"};
U_8 = sqrt(Ux_8.^2 + Uy_8.^2 + Uz_8.^2)
However, this yields the following error
Operator '.^' is not supported for operands of type 'cell'.
Error in speedPressure8Inlet (line 12)
U_8 = sqrt(Ux_8.^2 + Uy_8.^2 + Uz_8.^2)
I tried to use readmatrix instead of readtable but then x and z velocity components yield NaN type.
I think the main issue is that for Ux, Uz I have {''} characters. If they were not to be there there would not be a problem.
  1 Commento
JD_PM
JD_PM il 19 Mag 2022
Resolved: remove the braces from the original text file using, say, notepad (ctrl h and replace '(' by space) . So it was not a problem of Matlab actually.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by