Not enough input arguments.
Show older comments
I am getting Error: Not enough input arguments at Line 6 in this code. Can someone please help me with me with this.
function result = fix_ripe(input)
%%%%
%%This function fill the empty minuties with 0's for all the columns for
%%that miniee
%%%%
min_counter=input(1,3);%first miniute from the first pin
hour_counter=0;
missing_index=-1;
diff=-1;
for i=1:length(input)
if(input(i,3)~=min_counter)
if(input(i,3)<input(i-1,3))
diff(end+1)=60+input(i,3)-input(i-1,3)-1;
else
diff(end+1)=input(i,3)-input(i-1,3)-1;
end
missing_index(end+1)=i;
min_counter=input(i+1,3);
% if(min_counter<59)%min
% min_counter=min_counter+2;
% else %hours
% min_counter=1;
% if(hour_counter<23)
% hour_counter=hour_counter+2;
% else
% hour_counter=1;
% end
% end
else
if(min_counter<59)%min
min_counter=min_counter+1;
else %hours
min_counter=0;
if(hour_counter<23)
hour_counter=hour_counter+1;
else
hour_counter=0;
end
end
end
end
missing_index=missing_index(2:end);
missing_index=missing_index-1;
diff=diff(2:end);
% result=-1;
% found=0;
% for i=1:length(input)
% if(ismember(i,missing_index))
% result(end+1)=0;
% found=found+1;
% else
% result(end+1)=input(i-found,3);
% end
%
% end
% result=result(2:end);
result=input;
for o=1:length(missing_index)
temp=[result(missing_index(o))+1,0,0,0,...
result(missing_index(o),5),...
result(missing_index(o),6),...
result(missing_index(o),7),...
result(missing_index(o),8),...
result(missing_index(o),9),...
result(missing_index(o),10),...
result(missing_index(o),11),...
result(missing_index(o),12),...
result(missing_index(o),13),...
result(missing_index(o),14),...
result(missing_index(o),15),...
result(missing_index(o),16),...
result(missing_index(o),17),zeros(24,1)'... 38 column
];%17 columns
% temp=[0,0,0,0,0,0,0,0,0,0,0];
for p=1:diff(o)
result=[result(1:missing_index(o),:); temp; result(missing_index(o)+1:end,:)];
end
missing_index(o+1:end)=missing_index(o+1:end)+diff(o);
end
if(min_counter~=0 && length(result(:,1))~=1440)%to solve the updates pins that does not start with 0
limit_left=input(1,3);
limit_right=input(end,3);
for u=1:(limit_left-limit_right-1)
temp=[input(end,1)+u,0,limit_right+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,zeros(24,1)'];%17 columns
result(end+1,:)=temp;
end
end
end
1 Comment
Star Strider
on 19 Aug 2014
Edited: Star Strider
on 19 Aug 2014
What line are you referring to?
By my count, Line 7 is:
hour_counter=0;
Accepted Answer
More Answers (1)
Doganay Karatas
on 14 Nov 2020
0 votes
Error using fill
Not enough input arguments.
Why do i get this error??
HERE IS MY CODE
t=0:pi/50:2*pi;
figure(1)
plot(t,sin(t))
figure (2)
fill (t,sin(t)),('g')
figure (3)
stairs (t,sin(t))
figure (4)
bar (t,sin(t))
end
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!