Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
workin on strings

Subject: workin on strings

From: m4 Chrennikov

Date: 24 Sep, 2010 16:31:09

Message: 1 of 7

Any other suggestions? Maybe computation geometry will help? Will the solution easier if I only use the cubes? (Bodies without the second-order surfaces)

I have another question:
How can I transform strings like
'A=1+2+3*4'
to
'A=U(1)+U(2)+U(3)*U(4)'
Just add brackets and U :-)
I'v wrote some code, but its not perfect.

Subject: workin on strings

From: someone

Date: 24 Sep, 2010 17:00:27

Message: 2 of 7

"m4 Chrennikov" <abrek77@gmail.com> wrote in message <i7ijod$4tq$1@fred.mathworks.com>...
> Any other suggestions? Maybe computation geometry will help? Will the solution easier if I only use the cubes? (Bodies without the second-order surfaces)
>
> I have another question:
> How can I transform strings like
> 'A=1+2+3*4'
> to
> 'A=U(1)+U(2)+U(3)*U(4)'
> Just add brackets and U :-)
> I'v wrote some code, but its not perfect.

doc strrep

str = strrep('A=1+2+3*4', '1', 'U(1)')
% etc...

Subject: workin on strings

From: m4 Chrennikov

Date: 24 Sep, 2010 20:11:22

Message: 3 of 7

wanted to reply in my old thread, but did a mistake
this is the original thread
http://www.mathworks.com/matlabcentral/newsreader/view_thread/292044#781186
Admins, please move msgs from this thread to old.

someone

I read that, but can not understand how to realise this with random number. I want to replace *NUMBER* by U(*NUMBER*)

Subject: workin on strings

From: Walter Roberson

Date: 24 Sep, 2010 20:12:31

Message: 4 of 7

On 10-09-24 03:11 PM, m4 Chrennikov wrote:
> wanted to reply in my old thread, but did a mistake
> this is the original thread
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/292044#781186
> Admins, please move msgs from this thread to old.
>
> someone
> I read that, but can not understand how to realise this with random
> number. I want to replace *NUMBER* by U(*NUMBER*)

That makes no sense -- your original thread made no reference to "NUMBER".

Subject: workin on strings

From: Matt Fig

Date: 24 Sep, 2010 20:41:21

Message: 5 of 7

Perhaps you mean something like this:


str = 'A=1+2+3*400'
str2 = regexprep(str,'\d+','U($0)')

Subject: workin on strings

From: m4 Chrennikov

Date: 26 Sep, 2010 06:37:05

Message: 6 of 7

"Matt Fig" <spamanon@yahoo.com> wrote in message <i7j2dg$6vh$1@fred.mathworks.com>...
> Perhaps you mean something like this:
>
>
> str = 'A=1+2+3*400'
> str2 = regexprep(str,'\d+','U($0)')
many thanks, this is it)

Subject: workin on strings

From: Jan Simon

Date: 26 Sep, 2010 20:18:06

Message: 7 of 7

Dear m4 Chrennikov,

> Admins, please move msgs from this thread to old.

This is a newsgroup. No admins, no message moving.

Kind regards, Jan

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us