Error using function: Too many input arguments.
Show older comments
Hello,
so i have a prediction model code, with 15 inputs, and one output, and the code is working perfectly,
and i have saved the net file of this prediction, then I am trying to call a function with this net.file
the function:
script:
function outputPower = predictPVOutput(inputData)
load('net')
outputPower = net(inputData);
end
command window:
predictPVOutput(4,40,277,7,0,0,0.16,-30,3.2,0,0,96.2,1020,271,4)
error:
Error using predictPVOutput
Too many input arguments.
So what how can i call this function?
I have 15 inputs not 1,
Thanks in advance
Accepted Answer
More Answers (2)
Taylor
on 11 Jan 2024
0 votes
"net" is not configured for as many inputs as you are providing. You will either need to reduce your number of inputs or edit the network to accept 15 inputs.
Hassaan
on 11 Jan 2024
function outputPower = predictPVOutput(inputData)
load('net'); % Load your neural network model
outputPower = net(inputData);
end
Now, you should create an array or matrix that contains your 15 input values and pass that array as a single input argument to the function. For example:
inputData = [4, 40, 277, 7, 0, 0, 0.16, -30, 3.2, 0, 0, 96.2, 1020, 271, 4];
output = predictPVOutput(inputData);
---------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
- Technical Services and Consulting
- Embedded Systems | Firmware Developement | Simulations
- Electrical and Electronics Engineering
Feel free to contact me.
Categories
Find more on Deep Learning Toolbox 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!