When argument 'method' was a char variable, the argument checking mechanism was initialising sNorm correctly, then overwriting the value of the initialised sNorm with the value of 'method'. The initialisation was correct, and should not get overwritten.
When the modification has been made, calling som_norm_variable(x, 'var', 'do') will return a normalised x as expected. Unfixed, calling som_norm_variable(x, 'var', 'do') will result in an error:
Struct contents reference from a non-struct
array object.
Error in som_norm_variable (line 271)
(strcmp(operation,'do') &&
strcmp(sNorm(i).status,'uninit')),
When argument 'method' was a char variable, the argument checking mechanism was initialising sNorm correctly, then overwriting the value of the initialised sNorm with the value of 'method'. The initialisation was correct, and should not get overwritten.
When the modification has been made, calling som_norm_variable(x, 'var', 'do') will return a normalised x as expected. Unfixed, calling som_norm_variable(x, 'var', 'do') will result in an error:
Struct contents reference from a non-struct array object.
Error in som_norm_variable (line 271) (strcmp(operation,'do') && strcmp(sNorm(i).status,'uninit')),