why i got error on this coding for graphical method?
显示 更早的评论
clc
clear all
close all
T=0:200:1400;
f=(0.99403)+((1.671*10^-4)*(T))+((9.7215*10^-8)*(T^2))-((9.5838*10^-11)*(T^3))+((1.9520*10^-14)*(T^4))-(1.2);
plot(f,T)
grid on

the interval is 200-1400, i want to get the graph as above which i got from excel
回答(1 个)
KALYAN ACHARJYA
2020-5-2
T=0:200:1400;
f=(0.99403)+((1.671*10^-4)*(T))+((9.7215*10^-8)*(T.^2))-((9.5838*10^-11)*(T.^3))+((1.9520*10^-14)*(T.^4))-(1.2);
plot(f,T)
grid on
2 个评论
Muhamad Fadhil
2020-5-2
Walter Roberson
2020-5-3
T^2 compared to T.^2 .
The ^ operator corresponds to repeated use of the * operator, with the * operator being algebraic matrix multiplication. You can only use the ^ operator when you are working with square matrices, not with vectors:
T^2 with T being (1 x N) is (1 x N) * (1 x N) is error because the size of the second dimension of the first value, N, is not the same as the size of the first dimension of the second value, 1.
The .^ operator is element-by-element exponentiation, corresponding to repeated use of the .* operator. T.^2 is (1xN) .* (1.N) which is fine because the sizes match.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!