Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Concatenating strings
Replies: 3   Last Post: Jul 29, 2000 5:20 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Simon de Vet

Posts: 19
Registered: 12/7/04
Re: Concatenating strings
Posted: Jul 28, 2000 2:13 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

roster wrote:

> Maybe I haven't looked hard enough through the manual, but here's my
> question anyway:
>
> How do I concatenate a string? Specifically, I want to do something
> like:
>
> Value1 = 5
> String1 = " Value is " + Value1
>
> such that String1 is now " Value is 5"


Try:

Value1 = 5
String1=([' Value is ' num2str(Value1)])

This produces one string of length 11.

The secret seems to be in putting the stings into an array. I'm pretty
new to Matlab so I don't know the details of how this works, but I've
used it without problems.

"help matlab/strfun" lists most of the handy string functions. I've
found pretty much all I need in there, and in the manual.

Good luck!


Simon






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.