フィルターのクリア

How to compute the speed from the following dat file

1 回表示 (過去 30 日間)
JD_PM
JD_PM 2022 年 5 月 19 日
コメント済み: JD_PM 2022 年 5 月 19 日
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 件のコメント
JD_PM
JD_PM 2022 年 5 月 19 日
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by