How to use symbolic vector

1 view (last 30 days)
Behzad
Behzad on 21 May 2014
Commented: Behzad on 22 May 2014
Dear all,
I want to use each cell of a symbolic vector:
syms x y(x)
H = sym( 'H', [3 1] );
H(1,1) = x;
y = H(1,1);
dsolve( diff(y) == x^2, y(0) == 1 );
Error using sym>checkindex (line 2248)
Index must be a positive integer or logical.
Error in sym>privformatscalar (line 2198)
checkindex(x);
Error in sym>privformat (line 2182)
s = privformatscalar(x);
Error in sym/subsref (line 1387)
[inds{k},refs{k}] = privformat(inds{k});
Error in hamsym (line 42)
dsolve( diff(y) == x^2, y(0) == 1 )
but I received the bellow error:
I think it may be due to improper use of symbolic vector which changes "y" from a scalar to a 1x1 system.
Thanks a lot for your help.
  2 Comments
Walter Roberson
Walter Roberson on 22 May 2014
Which MATLAB version are you using?
Behzad
Behzad on 22 May 2014
Hi, 2012b

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!