How to use symbolic vector
1 次查看(过去 30 天)
显示 更早的评论
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 Center 和 File Exchange 中查找有关 Numbers and Precision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!