필터 지우기
필터 지우기

ERROR ... ----------​----------​----------​-------- cwt ---> Invalid Value for Scales !

조회 수: 2 (최근 30일)
zl
zl 2022년 5월 9일
댓글: zl 2022년 5월 11일
what is the reason for this error?
  댓글 수: 11
zl
zl 2022년 5월 10일
Thank you for your patient reply, this is the code I used, you can check it
zl
zl 2022년 5월 10일

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

채택된 답변

Walter Roberson
Walter Roberson 2022년 5월 10일
Compare the example_ground_motion.acc file with the ex1.acc and ex2.acc files. The example_ground_motion.acc file starts with
PEER NGA Rotated Accelerogram (v1.1)
H1 for rotation: SAN FERNANDO 02/09/71 14:00, PACOIMA DAM, 254 (CDMG STATION 279)
H2 for rotation: SAN FERNANDO 02/09/71 14:00, PACOIMA DAM, 164 (CDMG STATION 279)
rotation angle - clockwise 31.0
FN component, azimuth = 195.0
Acceleration in g
4164 0.01000 NPTS, DT
and then there are 5 columns of data (but the last row in the file does not have all 5 entries.)
The ex1.acc and ex2.acc files just start directly in to data, after a one-line header, such as
0.01 22600
-0.016
-0.055
-0.070
The code you are using, main_analyze_ground_motion.m expects that multi-line header, and does some fixed-format reading of the file in places, in order to extract dt (the timestep). When with the data in the file not being in the expected form, sometimes at the point it does the reading of dt, the next available data in the file just happens to be a valid floating point number less than 1. That is the case for ex1.acc : even though the data is not in the expected format, it just happens to read in 0.0153 for the time step, and that value does not happen to lead to a code crash.
But for ex2.acc, after doing the fixed-format reading, the file just happens to be positioned after the decimal point of a number, and it ends up reading 0.517 without the leading 0.5 so it is parsing 17 and reads that as 17. That happens to crash the program as the code needs a value less than about 0.178 in order for a vector needed by cwt to happen to start with a value greater than 0.
The solution is to only use .acc files that have the expected file header... or to use some other code to read the .acc files.
  댓글 수: 1
zl
zl 2022년 5월 11일
This problem has been solved. Thank you very much for your patient reply and answer. Thank you very much indeed@Walter Roberson

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by