|
91 | 91 | error( errorStruct ); |
92 | 92 | end |
93 | 93 |
|
| 94 | +% ensure finite x-coordinates |
| 95 | +if ~all( isfinite( positions_x ) ) |
| 96 | + errorStruct.message = 'positions_x must contain finite x-coordinates!'; |
| 97 | + errorStruct.identifier = 'das_pw:NoFiniteXCoordinates'; |
| 98 | + error( errorStruct ); |
| 99 | +end |
| 100 | + |
94 | 101 | % ensure numeric and real-valued row vector for positions_z |
95 | 102 | if ~( isnumeric( positions_z ) && isreal( positions_z ) && isrow( positions_z ) ) |
96 | 103 | errorStruct.message = 'positions_z must be a numeric and real-valued row vector!'; |
97 | 104 | errorStruct.identifier = 'das_pw:NoNumericAndRealRowVector'; |
98 | 105 | error( errorStruct ); |
99 | 106 | end |
100 | 107 |
|
101 | | -% ensure positive z-coordinates |
102 | | -if ~all( positions_z > 0 ) |
103 | | - errorStruct.message = 'positions_z must contain positive z-coordinates!'; |
104 | | - errorStruct.identifier = 'das_pw:NoPositiveZCoordinates'; |
| 108 | +% ensure positive and finite z-coordinates |
| 109 | +if ~( all( positions_z > 0 ) && all( isfinite( positions_z ) ) ) |
| 110 | + errorStruct.message = 'positions_z must contain positive and finite z-coordinates!'; |
| 111 | + errorStruct.identifier = 'das_pw:NoPositiveAndFiniteZCoordinates'; |
105 | 112 | error( errorStruct ); |
106 | 113 | end |
107 | 114 |
|
|
119 | 126 | error( errorStruct ); |
120 | 127 | end |
121 | 128 |
|
| 129 | +% ensure finite RF data |
| 130 | +if ~all( isfinite( data_RF ) ) |
| 131 | + errorStruct.message = 'data_RF must contain finite samples!'; |
| 132 | + errorStruct.identifier = 'das_pw:NoFiniteRFData'; |
| 133 | + error( errorStruct ); |
| 134 | +end |
| 135 | + |
122 | 136 | % ensure numeric and real-valued scalar for f_s |
123 | 137 | if ~( isnumeric( f_s ) && isreal( f_s ) && isscalar( f_s ) ) |
124 | 138 | errorStruct.message = 'f_s must be a numeric and real-valued scalar!'; |
|
127 | 141 | end |
128 | 142 |
|
129 | 143 | % ensure positive and finite f_s |
130 | | -if ~( f_s > 0 && f_s < Inf ) |
| 144 | +if ~( f_s > 0 && isfinite( f_s ) ) |
131 | 145 | errorStruct.message = 'f_s must be positive and finite!'; |
132 | 146 | errorStruct.identifier = 'das_pw:InvalidSamplingRate'; |
133 | 147 | error( errorStruct ); |
|
155 | 169 | end |
156 | 170 |
|
157 | 171 | % ensure positive and finite element_width |
158 | | -if ~( element_width > 0 && element_width < Inf ) |
| 172 | +if ~( element_width > 0 && isfinite( element_width ) ) |
159 | 173 | errorStruct.message = 'element_width must be positive and finite!'; |
160 | 174 | errorStruct.identifier = 'das_pw:InvalidElementWidth'; |
161 | 175 | error( errorStruct ); |
|
169 | 183 | end |
170 | 184 |
|
171 | 185 | % ensure larger element_pitch than element_width and finite element_pitch |
172 | | -if ~( element_pitch > element_width && element_pitch < Inf ) |
| 186 | +if ~( element_pitch > element_width && isfinite( element_pitch ) ) |
173 | 187 | errorStruct.message = 'element_pitch must be larger than element_width and finite!'; |
174 | 188 | errorStruct.identifier = 'das_pw:InvalidElementPitch'; |
175 | 189 | error( errorStruct ); |
|
183 | 197 | end |
184 | 198 |
|
185 | 199 | % ensure positive and finite c_0 |
186 | | -if ~( c_0 > 0 && c_0 < Inf ) |
| 200 | +if ~( c_0 > 0 && isfinite( c_0 ) ) |
187 | 201 | errorStruct.message = 'c_0 must be positive and finite!'; |
188 | 202 | errorStruct.identifier = 'das_pw:InvalidSpeedOfSound'; |
189 | 203 | error( errorStruct ); |
|
0 commit comments