Raspberry Pi uses TCPIP communication
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi
I'm working on deploy my code to raspberry pi to control the temperature in house.But it always remind me:
Error calling 'networklibcoder.tcpclient.write'. This call-site passes more inputs to this function than it can accept.
I don't know how to write the code that can be deployed to Raspberry Pi,here is my code.Can you give me some advice?
T = tcpclient('IP for PC',5900);
Troom = read(T,1,"double");
t = 1:86400;
for k = 1:4
tout = (8*sin(2*pi/(12 * 3600)*t(k:k+3))+12)';
end
g = 41;
optimal = [];
for i = 1:g
all = coder.load('soldata.mat');
data = struct2cell(all);
H = data{1}{i}.H;
K = data{1}{i}.K;
Fi = data{1}{i}.Fi;
Gi = data{1}{i}.Gi;
if H*[Troom;tout] <= K
optimal(i) = Fi * [Troom;tout] + Gi;
else
optimal(i) = 1;
end
end
S_pre = min(optimal);
out = S_pre;
t = tcpclient("IP for PC", 18734);
write(t, out, "double");
Many thanks,
Bang
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Support Package for Raspberry Pi Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!