No more input arguements

function in = localResetFcn1(in)
% Randomize reference signal
blk = sprintf('rlconicaltank/RL DDPGAgent');
h = 3*randn + 10;
while h <= 0 || h >= 20
h = 3*randn + 10;
end
in = setBlockParameter(in,blk,'Values',num2str(h));
% Randomize initial height
h = 3*randn + 10;
while h <= 0 || h >= 20
h = 3*randn + 10;
end
blk = 'rlconicaltank/RL DDPGAgent/H';
in = setBlockParameter(in,blk,'InitialCondition',num2str(h));
end
output:
>> localResetFcn1
Not enough input arguments.
Error in localResetFcn1 (line 9)
in = setBlockParameter(in,blk,'Values',num2str(h));
I have been trying to fix this error, but i am unable to fix this. it would be really very useful if anyone just find the bug and help me in fixing the error.

Answers (1)

Your function is defined to use an input argument.
function in = localResetFcn1(in)
You reference that input argument in your code.
in = setBlockParameter(in,blk,'Values',num2str(h));
What value are you providing that function when you call it?
>> localResetFcn1
You aren't, and so MATLAB doesn't know what in is when it tries to use that variable. Thus it throws the error.
To fix the problem you need to modify your call to tell localResetFcn1 what in is. Replace <you need to fill this in> in the code below with whatever in should be. I don't know what it should be because I don't know the context in which you're calling this function.
>> localResetFcn1(<you need to fill this in>)

Categories

Find more on Reinforcement Learning Toolbox in Help Center and File Exchange

Products

Release

R2021a

Asked:

on 28 Apr 2021

Answered:

on 28 Apr 2021

Community Treasure Hunt

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

Start Hunting!