How to print variable into different rows?

2 次查看(过去 30 天)
f = COF_S / C_ratio; % Coefficient of friction, f
e = Eccen_Rat_S ; % Eccentricity Ratio, e
Q = FV_S * r * c * N * L; % Lubricant Flow Rate, Q (m^3/s)
Qs = FR_S * Q ; % Lubricant Side Flow Rate, Qs (m^3/s)
Tmax = Temp_in + delta_T ; % Maximum Temperature, Tmax (°C)
ho = (MFT_S)*c; % Minimum Film Thickness,ho (m)
Phi = Pos_MFT_S ; % Position of minimum film thickness (deg)
Term_pos = TPF_S ; % Terminating position of film (deg)
Max_FP = P/(MFP_S); % Maximum Film Pressure, Pmax (Pascal,Pa)
pos_max_FP = PFMP_S ; % Position of maximum film pressure (deg)
T = f*W*r ; % Friction Torque, T (N.m)
Hp = (T*(N*60))/9550; % Frictional Horsepower, (hp)ƒ in(hp)
I was wondering on how to display/ print these variables into rows . I mean once I have run the script, I want to display all these variables with its respective values.

采纳的回答

Adam Danz
Adam Danz 2019-8-7
编辑:Adam Danz 2019-8-8
If you just want to display the variables in the command window, merely list the variables without a terminal semicolon which would normally suppress the display.
f = COF_S / C_ratio; % Coefficient of friction, f
e = Eccen_Rat_S ; % Eccentricity Ratio, e
Q = FV_S * r * c * N * L; % Lubricant Flow Rate, Q (m^3/s)
Qs = FR_S * Q ; % Lubricant Side Flow Rate, Qs (m^3/s)
Tmax = Temp_in + delta_T ; % Maximum Temperature, Tmax (°C)
ho = (MFT_S)*c; % Minimum Film Thickness,ho (m)
Phi = Pos_MFT_S ; % Position of minimum film thickness (deg)
Term_pos = TPF_S ; % Terminating position of film (deg)
Max_FP = P/(MFP_S); % Maximum Film Pressure, Pmax (Pascal,Pa)
pos_max_FP = PFMP_S ; % Position of maximum film pressure (deg)
T = f*W*r ; % Friction Torque, T (N.m)
Hp = (T*(N*60))/9550; % Frictional Horsepower, (hp)ƒ in(hp)
% LATER IN YOUR CODE
% Without the semicolon at the end (;), these variable names and their values
% will all display in the command window.
f
e
Q
Qs
Tmax
ho
Phi
Term_pos
Max_FP
pos_max_FP
T
Hp
Another alternative is to collect the variables into cell array for a more compact display
c = {'f', f;
'e', e;
'Q', Q};
disp(c) % display c in command window

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by