Error using function: Too many input arguments.
古いコメントを表示
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
採用された回答
その他の回答 (2 件)
Taylor
2024 年 1 月 11 日
0 投票
"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
2024 年 1 月 11 日
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.
カテゴリ
ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!