## index notation symbolic toolbox

### Dinant (view profile)

on 4 Nov 2013
Latest activity Answered by Dinant Kistemaker

### Dinant Kistemaker (view profile)

on 26 Feb 2019
example: fi = sym('fi',[1 2]) fi =
[ fi1, fi2]
I want this to be: fi =
[ fi(1), fi(2)]
This in order to use outcome of symbolic manipulation directly in my matlab code.

Show 1 older comment
Dinant

### Dinant (view profile)

on 19 Feb 2014
Really? Somebody of the Mathworks?
Sean de Wolski

### Sean de Wolski (view profile)

on 20 Feb 2014
Dinant Kistemaker

### Dinant Kistemaker (view profile)

on 19 Feb 2019
Thanks for the help, but you did not. I have reinitiated my post in hope I can get a workaround for this...

### Sean de Wolski (view profile)

on 4 Nov 2013

>> fi = sym([1,2])
?

### Dinant (view profile)

on 4 Nov 2013

hmmm, what do you mean with the question mark?

Sean de Wolski

### Sean de Wolski (view profile)

on 4 Nov 2013
Dinant, this is what my code does:
clear fi;
fi = sym([1 2]);
sin(fi(1))
It will not return two separate outputs because this is not how MATLAB works. Consider the same question for doubles:
[D(1) D(2)] = [1 2]; %error!
You would need to do this on two lines:
D(1) = 1;
D(2) = 2;
Knowing [1 2] upfront you would want
D = [1 2]
Then
D(1)
Dinant

### Dinant (view profile)

on 4 Nov 2013
My question relates to the fact that directly want to use the output of symbolic manipulations in my matlab code that is vectorized. Symbolic output is not. It makes from fi(1) fi1. I do not want that. I want the output to be in terms of fi(1), fi(2), etc.
Sean de Wolski

### Sean de Wolski (view profile)

on 4 Nov 2013
What release are you using? Because on mine(R2013b) it creates a 1x2 sym
Code:
fi = sym([1 2])
size(fi)
sin(fi(1))
Printed:
fi =
[ 1, 2]
ans =
1 2
ans =
sin(1)

### Walter Roberson (view profile)

on 4 Nov 2013

syms fi
then fi(1) will be fi(1)

Dinant

### Dinant (view profile)

on 4 Nov 2013
nope...
>> syms fi >> fi(1) ans = fi

### Dinant Kistemaker (view profile)

on 19 Feb 2019

I am still very much looking forward to an answer to my question. It is really annyoing that the printed format is not in vector notation. I want to use the output for some symbolic manipulations in my code and I want to use vector notation.
if I type:
fi = sym ('fi',[1 3]);
x=cos(fi)
>>x =
[ cos(fi1), cos(fi2), cos(fi3)]
I would very much want to have the answer in vector notation like:
x =
[ cos(fi(1)), cos(fi(2)), cos(fi(3))]