How to use symbolic vector

1 次查看(过去 30 天)
Behzad
Behzad 2014-5-21
评论: Behzad 2014-5-22
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by