フィルターのクリア

Using parfeval and getting "Not enough input arguments"

6 ビュー (過去 30 日間)
Jeff Beckstead
Jeff Beckstead 2022 年 1 月 31 日
編集済み: Benjamin Thompson 2022 年 1 月 31 日
I am attempting to use the parfeval function. I routinely get "not enough input arguments" error. Below is a very simplified script, and this gets the same error message. This function simply is trying to open two xml files at the defined path and the filename. If I run the function directly (line commented out with "% %" the function works fine. When attempt to use with parfeval, get the "not enough input arguments" at the link "systemStruc = readstruct(..."
Eventually this will be built into a compiled version. This is very simplied sample of function code, but even this gives me the error.
%test parfeval
systemXmlPath = 'D:\myTestSystem';
systemStatusFile = 'myTestSystemStatus.xml';
WatchID = parfeval( backgroundPool, twoParameterFunction, 1, systemXmlPath, systemStatusFile );
% % result = twoParameterFunction(systemXmlPath, systemStatusFile);
disp('passed off');
function [result] = twoParameterFunction(systemXmlPath, systemStatusFile)
%default
result = false;
%set system level paths and read system defined parameters from the XML
systemStruct = readstruct(fullfile( systemXmlPath,'myTestConfiguration.xml'));
debugLevel = systemStruct.ImageProcess.DebugLevel;
resultsStructIn = readstruct( systemStruct.Folders.ResultsFile);
statusRead = readstruct(fullfile(systemXmlPath, systemStatusFile));
result = statusRead;
end

採用された回答

Benjamin Thompson
Benjamin Thompson 2022 年 1 月 31 日
編集済み: Benjamin Thompson 2022 年 1 月 31 日
You probably need an @ sign for the function handle, as in:
WatchID = parfeval( backgroundPool, @twoParameterFunction, 1, systemXmlPath, systemStatusFile );

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBackground Processing についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by