Not enough input arguments
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anthony Santana
am 3 Mär. 2023
Beantwortet: Walter Roberson
am 4 Mär. 2023
I am a novice and I ran this code in December with no issues. Now I get an error "Not enough input arguments. Error in line 7. alg.ptag = pid;.
I was just prompted to renew my license, not sure if that changed my version to a new one that works differently.
How can I rewrite it so that it works? Did something change in Matlab?
function initalg(pid)
% Setting global parameters
global alg
alg = {};
% parameters to use
alg.ptag = pid;
3 Kommentare
Walter Roberson
am 4 Mär. 2023
it might be an attempt to clear the previous value of the the global since this is an initialization function. It should probably be something like
alg = struct() ;
Akzeptierte Antwort
Walter Roberson
am 4 Mär. 2023
The error message is telling you that you did one of three things:
- You invoked initalg or initalg() at the command line without providing any parameter for the function; OR
- You had code that called initalg() without passing in any parameter to the function; OR
- you were in the editor at initalg.m file and you pressed the green Run button. The Run button is equivalent to invoking the function without any parameters.
0 Kommentare
Weitere Antworten (1)
Les Beckham
am 3 Mär. 2023
Perhaps you have added the control system toolbox since last time this worked?
That toolbox contains a function named pid that expects input arguments.
which -all pid
help pid
Siehe auch
Kategorien
Mehr zu PID Controller Tuning finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!