Should Behavior of sub2ind() be Different for Symbolic and Numeric Inputs?
Show older comments
maxrows = 1; r = 1; a = 1; c = 1; ii = false;
D = zeros(3,3,maxrows) % D is a double
D(sub2ind([3,3,maxrows],a(ii),a(ii),r(ii))) = c(ii)
D = zeros(3,3,maxrows,'sym') % now D is a sym
D(sub2ind([3,3,maxrows],a(ii),a(ii),r(ii))) = c(ii)
Why does sub2ind() change the dimension of D in the latter case?
1 Comment
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

