我模仿教科書的寫法
% Script file: rad _ deg
x = 0:0.314:2*pi; % creates the row vector x
y1 = sin(x); % creates the row vector sin(x)
y2 = cos(x); % creates the row vector cos(x)
z = x*180/pi; % converts radians to degrees
disp('****************************')
disp('x( deg) x (rad) sin(x) cos(x)')
disp('****************************')
[z' x' y1' y2] % displays in table format
disp('****************************')
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Error in rad_deg (line 9)
[z' x' y1' y2] % displays in table format
google了一下午 找不到原因
謝謝