[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: send octave output to string
From: |
Bill Denney |
Subject: |
Re: send octave output to string |
Date: |
Sun, 07 Sep 2008 19:17:12 -0400 |
User-agent: |
Thunderbird 2.0.0.16 (Windows/20080708) |
charles reid wrote:
> Hi there -
>
> I've been searching Octave documentation & the web with no luck on
> this, so I thought I would ask here. If I want to send the output of
> an Octave command to a string, how would I do that? For example, if I
> type
>
> >> a = 2 + 2
>
> And I want a string to contain the resulting " a = 4 ", how would I do
> that? Thanks!
You're looking for num2str or sprintf:
num2str(a)
or
spritnf("%d", a)
Have a good day,
Bill