Matlab: Convert [2x1 sym] to a numerical value

Below is my code and I wish to solve for A, B, C and D. How do i change the code to get numerical values for A, B, C and D? Instead of [2x1 sym].
syms A B C D
E = (89*50*sind(170))+(92.3*A*sind(C))+(83.3*B*sind(D))==0;
F = (89*50*cosd(170))+(92.3*A*cosd(C))+(83.3*B*cosd(D))==0;
G = (89*sind(170)) + (92.3*sind(C)) + (83.3*sind(D))==0;
H = 68.4 + (89*cosd(170)) + (92.3*cosd(C)) + (83.3*cosd(D))==0;
s = solve([E,F,G,H],[A,B,C,D])
When the code is run:
RV1_SDbalancing
s =
struct with fields:
A: [2×1 sym]
B: [2×1 sym]
C: [2×1 sym]
D: [2×1 sym]

 Accepted Answer

syms A B C D
E = (89*50*sind(170))+(92.3*A*sind(C))+(83.3*B*sind(D))==0;
F = (89*50*cosd(170))+(92.3*A*cosd(C))+(83.3*B*cosd(D))==0;
G = (89*sind(170)) + (92.3*sind(C)) + (83.3*sind(D))==0;
H = 68.4 + (89*cosd(170)) + (92.3*cosd(C)) + (83.3*cosd(D))==0;
s = solve([E,F,G,H],[A,B,C,D])
s = struct with fields:
A: [2×1 sym] B: [2×1 sym] C: [2×1 sym] D: [2×1 sym]
double(s.A)
ans = 2×1
179.1120 136.9546
double(s.B)
ans = 2×1
205.5649 110.5017

More Answers (0)

Categories

Find more on Get Started with MATLAB 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!