Symbolic substitution for variable subscripts
1 次查看(过去 30 天)
显示 更早的评论
How should I perform the following substitution:
? Can the subs function be used? Or do I have to take a manual approach and use sprintf into a char representation of the expression before converting it to symbolic form?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/237103/image.png)
1 个评论
Walter Roberson
2019-9-5
Supposing your a is to be 17 x 3, then
a = sym('a', [17 3]);
and then for any given numeric subscript j, sum(a(j,:))
However it is not possible to create the sum when j is symbolic
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!