Error plotting invalid second data argument

1 次查看(过去 30 天)
I like to make 2 PLOTS, but I getan error messages. I use the same x-values, a cell array I have made PLOTS with hese values earlier. The problem are caused by the Y values. The PLOTs (called real) gives the error Invalid second data argument. Although i used the same code the Y-values dont look the same. the values TC, TC2 and sf/IR are
if true
% code
TC = cell2mat(TC);
TC2 = cell2mat(TC2);
SF = cell2mat(SF);
for U = 1:b
temperatuurreal{1,U}(1:TC(1,U),1)=celldata{1,U}(1:TC(1,U),6);
temperatuurreal{1,U}(TC(1,U)+1:TC(1,U)+SF(1,U),1)=celldata{1,U}(TC(1,U)+1:TC(1,U)+SF(1,U),8);
temperatuurreal{1,U}(TC(1,U)+SF(1,U)+1:TC(1,U)+SF(1,U)+TC2(1,U),1)=celldata{1,U}(TC(1,U)+SF(1,U)+1:TC(1,U)+SF(1,U)+TC2(1,U),6);
temperatuurset{1,U}(1:TC(1,U),1)=celldata{1,U}(1:TC(1,U),5);
temperatuurset{1,U}(TC(1,U)+1:TC(1,U)+SF(1,U),1)=celldata{1,U}(TC(1,U)+1:TC(1,U)+SF(1,U),7);
temperatuurset{1,U}(TC(1,U)+SF(1,U)+1:TC(1,U)+SF(1,U)+TC2(1,U),1)=celldata{1,U}(TC(1,U)+SF(1,U)+1:TC(1,U)+SF(1,U)+TC2(1,U),5);
end
laatste=b;
%axis([tMin tMax 0.5 2.2]);
while laatste > 0
figure('Name','setpoint and real')
%plot(x{1,b}(:,1),temperatuurreal{1,b}(:,1))
hold on
plot(x{1,b}(:,1),temperatuurset{1,b}(:,1))
title('setpointenreal')
xlabel('tijd(s)')
ylabel('temperatuur(C)')
legend(num(1,1:b))
b=b-1;
end
end
  3 个评论
Eliah Verbeemen
Eliah Verbeemen 2018-5-25
编辑:Eliah Verbeemen 2018-5-25
I provided an example of TC. SF/IR en TC2 are comparable.
Maria
Maria 2018-5-25
I do not see any .mat attachment. Am I missing something?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by