Not enough input arguments.
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Prerna Batta
il 19 Ago 2014
Risposto: Doganay Karatas
il 14 Nov 2020
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 Commento
Star Strider
il 19 Ago 2014
Modificato: Star Strider
il 19 Ago 2014
What line are you referring to?
By my count, Line 7 is:
hour_counter=0;
Risposta accettata
Guillaume
il 19 Ago 2014
Which is line 7? By my count it would be hour_counter = 0 but that line can't generate the error you mention.
Provide the right number of arguments to whichever function you're calling on the line where you're getting the error
On a side note, do not name your variables input or diff as these are the names of some matlab built-in functions. It will only cause you a lot of grief in the future if you keep these names.
4 Commenti
Guillaume
il 19 Ago 2014
Rename your input variable to something more meaningful that isn't also a matlab function (and also rename your diff variable). If the error persists, copy-paste the entire error message here.
Image Analyst
il 19 Ago 2014
Exactly Prerna. That's what we're saying. Rename input everywhere you see it to inputArray or something and try again.
Più risposte (1)
Doganay Karatas
il 14 Nov 2020
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
0 Commenti
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!