'Solve' produces solutions one some computers, but not others
Show older comments
Hi!
I have a rather confusing problem. I have an array 7x1 sym:
F=
1 - conc2 - conc3 - conc4 - conc5 - conc6 - conc7 - conc1
(2*conc4 + 2*conc5)/(2*conc1 + conc2 + 2*conc3 + conc4 + conc6) - 137/171
(2*conc4 + 2*conc5)/(conc1 + conc2) - 685/256
(2*conc4 + 2*conc5)/(conc6 + 2*conc7) - 137/642
(conc2*conc3^(1/2))/conc1 - 3327435595198581/288230376151711744
(conc3^(1/2)*conc5)/conc4 - 298932303587285/144115188075855872
(conc3^(1/2)*conc7^(1/2))/conc6 - 3468615750991967/140737488355328
I use solve on this array, and evaluate the expressions to get numeric values:
solution = solve(F)
names = fieldnames(solution);
l=length(names);
answer=zeros(l,1);
for a=1:l
answer(a)=eval(getfield(solution, names{a}));
end
When I run it on my computer (Windows 7, Matlab 2013a) I get:
answer =
0.1015
0.0137
0.0073
0.1504
0.0036
0.0029
0.7205
However, on some other computers (in general running on Matlab 2015a) 'solve' returns rather complex expressions that use RootOf and z, which eval cannot handle. Has anyone got a clue what might be the cause and how it might be solved?
1 Comment
Gunnar Larsson
on 29 Nov 2015
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!