필터 지우기
필터 지우기

code wont match dimensions

조회 수: 1 (최근 30일)
Boss Man
Boss Man 2019년 12월 24일
댓글: Boss Man 2019년 12월 24일
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

채택된 답변

David Hill
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.
  댓글 수: 1
Boss Man
Boss Man 2019년 12월 24일
thank u so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by