Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Why do i keep getting this error???

6 ビュー (過去 30 日間)
Boss Man
Boss Man 2020 年 1 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
so heres the data file
outdoor = xlsread('outdoorall.xlsx','G2:H52364');
indoor=xlsread('indoorall.xlsx','G2:H52364'); %2397
time=xlsread('outdoorall.xlsx','G2:G52364');
a=(outdoor);
b=(indoor);
dt=diff(b(:,2))/0.00138889; % difference in indoor temp divided by time in hrs(=5secs)
c=dt./(b(2:end,2)-a(2:end,2));%diff(a) will be one less than matrix a and b
plot(c,time)
I get an error that the vectors dont match up. I asked my supervisor this and he said to take a look at diff. I didn't understand as I'm not too good at matlab. I've quoted the time, temperatures correctly.

回答 (1 件)

Spencer Chen
Spencer Chen 2020 年 1 月 28 日
It's hard to determine the exact problem with the information you have provided. It would be much better if you had copy and pasted the error message.
My guess is that your code fails at
plot(c,time)
Because your time vector size is different to your c vector.
Blessings,
Spencer

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by