From: Chris on
I am trying change a value based on its position relative to a zero

spaces = (str == ' ') % returns 1 at all blank spaces

now I would like to change every position directly after the 1's.
I'm trying to use:
str(spaces) = (str(spaces))+'a'-'A'

but this only changes the blank positions (the 1's)... Can someone help me?
From: ImageAnalyst on
Chris :
You didn't say what you want to change the position after the space
to. So in this example, I just changed to the character to "X."

str = 'The quick brown fox jumped over the lazy dog.'
spaces = find(str == ' ') % returns 1 at all blank spaces
str(spaces+1) = 'X'

str =
The quick brown fox jumped over the lazy dog.

spaces =
4 10 16 20 27 32 36 41

str =
The Xuick Xrown Xox Xumped Xver Xhe Xazy Xog.
From: Walter Roberson on
Chris wrote:
> I am trying change a value based on its position relative to a zero
>
> spaces = (str == ' ') % returns 1 at all blank spaces
>
> now I would like to change every position directly after the 1's.
> I'm trying to use:
> str(spaces) = (str(spaces))+'a'-'A'
>
> but this only changes the blank positions (the 1's)... Can someone help me?

str([false spaces(1:end-1)])
From: Chris on
thanks for the help
I am trying to make the next letter capital without using "uppers"
so far I can only change all the letters to a different letter...
From: Chris on
figured it out ended up using:

str(spaces+1) = (str(spaces+1))+'A'-'a';
%capitalizes the first letter of each word

str(1) = str(1)+'A'-'a';
%capitalizes the first letter


Thanks for the help