Why is my matrix deformed?

4 次查看(过去 30 天)
TARIK YAMAN
TARIK YAMAN 2018-12-17
评论: madhan ravi 2018-12-18
edit : ı added code ı wrote.
%%%%%Code%%%%
clc;
clear;
clear all;
a = [0:0.1:360];
b = a.*pi/180;
c = sind(a);
d = cos(a);
e = c./d;
f = d./c;
T = [a;b;c;d;e;f];
str1 = 'angle';
str2 = 'radian';
str3 = 'sin';
str4 = 'cos';
str5 = 'tan';
str6 = 'cot';
fprintf('%s %s %s %s %s %s\t',str1,str2,str3,str4,str5,str6);
fprintf('%.1f %.4f %.4f %.4f %.4f %.4f\n',T);
%%%%code%%%%%

回答(1 个)

madhan ravi
madhan ravi 2018-12-17
编辑:madhan ravi 2018-12-17
fprintf('%s %s %s %s %s %s\n',str1,str2,str3,str4,str5,str6);
^--- not t
  2 个评论
madhan ravi
madhan ravi 2018-12-18
TARIK YAMAN's answer moved here for consistency:
thank u. @madhan ravi
madhan ravi
madhan ravi 2018-12-18
Anytime :) ,if my answer helped make sure to accept the answer.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by