Clear Filters
Clear Filters

Error plotting invalid second data argument

1 view (last 30 days)
Eliah Verbeemen
Eliah Verbeemen on 25 May 2018
Commented: Maria on 25 May 2018
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 Comments
Eliah Verbeemen
Eliah Verbeemen on 25 May 2018
Edited: Eliah Verbeemen on 25 May 2018
I provided an example of TC. SF/IR en TC2 are comparable.
Maria
Maria on 25 May 2018
I do not see any .mat attachment. Am I missing something?

Sign in to comment.

Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!