1

I have the following:

syms x;
F = {3*x,2*x,x};

I would like to make F the following array G:

G = [3*x,2*x,x];

To do this, I have tried this:

G = double(F);

and this:

 G = double([F{:}]).';

Neither options work. Is there a way to do this in MATLAB?

6
  • 2
    A “double” is a number, not a function nor a symbolic function. I think what you want to do is create a symbolic function that returns an array? Commented Mar 31, 2024 at 23:00
  • 3
    I don’t have access to the symbolic toolbox right now. Does G = [3*x,2*x,x] work? If so, then G = [F{:}] should work as well, I think. Commented Mar 31, 2024 at 23:03
  • @CrisLuengo G = [3*x,2*x,x] works and so does G=[F{:}]! Commented Apr 1, 2024 at 15:45
  • Wonderful! Please post an answer! Commented Apr 1, 2024 at 16:45
  • G = [3*x,2*x, x] should not be the answer for at least what you have posted above. You have written that G is your desired output result when your input is F = {3*x,2*x,x}; Commented Apr 2, 2024 at 4:29

1 Answer 1

1

The correct answer is G=[F{:}]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.