code wont match dimensions
1 次查看(过去 30 天)
显示 更早的评论
a=[00.00 22.3
00.06 22.4
00.11 22.4
00.16 22.5
00.21 22.4
00.26 22.4
00.31 22.3
00.36 22.2
00.41 22.2
00.46 22.1
00.51 22
00.56 21.9];
b=[00.00 3.8
00.05 3.8
00.10 3.8
00.15 3.7
00.20 3.6
00.25 3.6
00.31 3.5
00.36 3.5
00.41 3.4
00.45 3.4
00.50 3.3
00.55 3.3];
%matrix a of indoor temp
%matrix b of outdoor temp
dt=diff(a)/5;
c=dt./(b(1:end-1)-a(1:end-1));%diff(a) will be one less than matrix a and b
plot(c);
I want to display the left hand side of the matrix on the x-axis, don't want it involved in the calculations of c and dt. how would i do that?
thanks for any help given
0 个评论
采纳的回答
David Hill
2019-12-24
dt=diff(a(:,2))/5;
c=dt./(b(2:end,2)-a(2:end,2));%diff(a) will be one less than matrix a and b
plot(a(2:end,1),c);
This should work for you.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!