MATLAB: How to display the correct output of the product of matrix correctly when i wanted to conver degrees to radians

display of matrixmatrix manipulationproduct of matrixstring concatenation

hi all, below is my code and I am trying to display the result of a matrix mutiplication correctly. Does reshaping of matrix or contencation of string?
prompt = 'Enter the numbers for conversion? ';
x = input(prompt)
y = x*(pi./180); % formula to convert degrees to radians
fprintf("%d degree\n = %d radians\n", x ,y);
my output is as follows:
What are the number/numbers for conversion? [180 360]
180.000 degree
= 360.000 radians
3.142 degree
= 6.283 radians
>>
The correct display i wanted is 180 degrees = 3.142 , 360 degrees = 6.283 radians

Best Answer

prompt = 'Enter the numbers for conversion? ';
x = input(prompt)
y = x*(pi./180); % formula to convert degrees to radians
fprintf("%d \t %d degree\n = %d \t %d radians\n", x ,y);