help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Symbolic variable/expression in octave value list


From: Mike Miller
Subject: Re: Symbolic variable/expression in octave value list
Date: Mon, 10 Aug 2015 11:48:25 -0400

On Mon, Aug 10, 2015 at 11:27:20 +0530, Shamika Mohanan wrote:
> What is the right way to access symbolic expressions in octave value list?
>
> I have the following code-
>
> in = octave_value ('s');
> octave_value_list out =feval ("tf", in, 1);
> std::cout << out(0).string_value()<< std::endl;
>
> This shows the error-
>
> error: octave_base_value::convert_to_str_internal (): wrong type argument
> '<unknown type>'
>
> Is there an equivalent like 'is_double_type()' for symbolic expressions?

I'm not sure what you're asking, but you should be able to fix the
error and get the string representation of an octave_value like this
(untested):

  std::ostringstream os;
  out(0).print (os);
  std::string s = os.str ();

If that's not what you're looking for, can you clarify what you're trying to do?

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]