@@ -237,100 +237,6 @@ end
237237
238238For custom validation, create functions in ` mhkit/utils/ ` or module-specific directories.
239239
240- ## Documentation
241-
242- ### Docstring Format
243-
244- All public functions ** must** have properly formatted docstrings. This is enforced by automated CI checks.
245-
246- #### Simple Function Template
247-
248- ``` matlab
249- function Hm0 = significant_wave_height(S, frequency)
250-
251- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
252- % Calculate significant wave height from spectral density
253- %
254- % Parameters
255- % ------------
256- % S : vector or matrix
257- % Spectral density values [m^2/Hz]
258- % frequency : vector
259- % Frequency bins [Hz]
260- %
261- % Returns
262- % ---------
263- % Hm0 : double
264- % Significant wave height [m]
265- %
266- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267-
268- arguments
269- S double
270- frequency double
271- end
272-
273- Hm0 = 4 * sqrt(trapz(frequency, S));
274-
275- end
276- ```
277-
278- #### Complex Function Template (Struct Inputs/Outputs)
279-
280- ``` matlab
281- function mspl = band_sound_pressure_level(spsd, octave, base, fmin, fmax)
282-
283- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284- % Calculate band-averaged sound pressure levels from spectral density
285- %
286- % Computes sound pressure level in fractional octave bands from
287- % mean square sound pressure spectral density (SPSD).
288- %
289- % Parameters
290- % ------------
291- % spsd : struct
292- % Mean square sound pressure spectral density
293- % spsd.data : Spectral density data [Pa^2/Hz]
294- % spsd.freq : Frequency vector [Hz]
295- % spsd.time : Time vector
296- % spsd.fs : Sampling frequency [Hz]
297- % octave : int
298- % Octave subdivision (1 = full octave, 3 = third-octave)
299- % base : int (optional)
300- % Octave base subdivision (default: 2 for true octave)
301- % fmin : double (optional)
302- % Lower frequency band limit [Hz] (default: 10)
303- % fmax : double (optional)
304- % Upper frequency band limit [Hz] (default: 100000)
305- %
306- % Returns
307- % ---------
308- % mspl : struct
309- % Sound pressure level [dB re 1 uPa] indexed by time and frequency
310- % mspl.data : Sound pressure level data [dB re 1 uPa]
311- % mspl.freq : Center frequencies of bands [Hz]
312- % mspl.time : Time vector
313- %
314- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315-
316- arguments (Input)
317- spsd struct
318- octave {mustBeInteger, mustBePositive}
319- base {mustBeInteger} = 2
320- fmin {mustBeNumeric, mustBePositive} = 10
321- fmax {mustBeNumeric, mustBePositive} = 100000
322- end
323-
324- arguments (Output)
325- mspl struct
326- end
327-
328- % Implementation
329- mspl = struct();
330-
331- end
332- ```
333-
334240### Checking Your Docstrings
335241
336242Before submitting your PR, there is a python script to validate docstrings locally:
0 commit comments