Prev: Simulink Pulse Generator with amplitude between -1 and +1
Next: How to pass white gaussian noise through a filter
From: Jan Simon on 11 Feb 2010 07:24 Dear Chris! > spaces = (str == ' ') % returns 1 at all blank spaces > str(spaces) = (str(spaces))+'a'-'A' Another idea: afterspaces = strfind(str, ' ') + 1; str(afterspaces) = str(afterspaces) + ('a' - 'A'); The brackets accelerate the method: Without them this is calculated: (str(afterspaces) + 'a') - 'A' This might cause an overflow - but not for usual strings - and performs two vector operations, while the brackets around 'a' - 'A' yield to a single vector operation only. Kind regards, Jan |