How to add units when displaying a matrix using the disp command

21 views (last 30 days)
How do I add units to the end of my matrix. I tried u = symunit; but I couldn't manually display the micro symbol or add it inside of any of my disp commands.
k = 13;
disp(['Number of neutral strand = ' num2str(k)])
Number of neutral strand = 13
Rb = 1.269/2/12; % ft
disp(['Radius of the circle passing through the centers of the neutral strands, Rb = ' num2str(Rb) ' ft'])
Radius of the circle passing through the centers of the neutral strands, Rb = 0.052875 ft
RDc = 0.498/2/12; % ft
disp(['Phase conductor equivalent (self) radius, RDc = ' num2str(RDc) ' ft'])
Phase conductor equivalent (self) radius, RDc = 0.02075 ft
RDs = 0.1019/2/12; % ft
disp(['Neutral strand equivalent radius, RDs = ' num2str(RDs) ' ft'])
Neutral strand equivalent radius, RDs = 0.0042458 ft
yag = (77.3619i)/(log(Rb/RDc)-(1/k)*(log(k*(RDs/Rb)))); %μS/mile
disp(['Shunt admittance, yag = ' num2str(yag) ' μS/mile'])
Shunt admittance, yag = 0+82.9992i μS/mile
Yabc = diag([yag,yag,yag]);
disp(Yabc)
0.0000 +82.9992i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 +82.9992i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 +82.9992i

Accepted Answer

Walter Roberson
Walter Roberson on 7 Feb 2026 at 0:29
Moved: Walter Roberson on 7 Feb 2026 at 0:29
k = 13;
disp(['Number of neutral strand = ' num2str(k)])
Number of neutral strand = 13
Rb = 1.269/2/12; % ft
disp(['Radius of the circle passing through the centers of the neutral strands, Rb = ' num2str(Rb) ' ft'])
Radius of the circle passing through the centers of the neutral strands, Rb = 0.052875 ft
RDc = 0.498/2/12; % ft
disp(['Phase conductor equivalent (self) radius, RDc = ' num2str(RDc) ' ft'])
Phase conductor equivalent (self) radius, RDc = 0.02075 ft
RDs = 0.1019/2/12; % ft
disp(['Neutral strand equivalent radius, RDs = ' num2str(RDs) ' ft'])
Neutral strand equivalent radius, RDs = 0.0042458 ft
yag = (77.3619i)/(log(Rb/RDc)-(1/k)*(log(k*(RDs/Rb)))); %μS/mile
disp(['Shunt admittance, yag = ' num2str(yag) ' μS/mile'])
Shunt admittance, yag = 0+82.9992i μS/mile
Yabc = diag([yag,yag,yag]);
disp(Yabc)
0.0000 +82.9992i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 +82.9992i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 +82.9992i
temp = splitlines(formattedDisplayText(Yabc));
temp(1) = temp(1) + " μS/mile";
disp(char(temp))
0.0000 +82.9992i 0.0000 + 0.0000i 0.0000 + 0.0000i μS/mile 0.0000 + 0.0000i 0.0000 +82.9992i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 +82.9992i

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!