Sudden “Incorrect number or types of inputs or outputs for function invoke” error that I now have.
I have some code that previously worked for me with MATLAB and FRED, but is now throwing me an error. Simply put, I’m trying to open a file in FRED using a MATLAB script. This code had worked before the CrowdStrike incident, but after the incident I needed to reset my computer and reinstall all applications, and I’m not sure if having a different version of MATLAB is throwing an error for this. For reference, I’m using MATLAB version R2024a and FRED version 22.40. I tried contacting FRED support about this, but they had no idea how to fix it and suggested I look for MATLAB support.
I’m running the following lines of code:
system(‘cd c:Program FilesPhoton EngineeringFRED 22.40.4Bin & start fred.exe’); pause(1)
fredsvr = actxserver(‘FRED.Application’); pause(0.1)
freddoclist = get(fredsvr,’Documents’); pause(0.1)
set(fredsvr,’Visible’, 1);
testdoc = ‘C:UsersUSERNAMEDocumentsTESTDOCUMENT.frd’;
freddoc = invoke(freddoclist,’Open’,testdoc); pause(0.5);
When I get to the last line I get a message telling me that there is an "Incorrect number or types of inputs or outputs for function invoke", which is an error I didn’t previously see when I ran the code and it worked (a few months ago). It seems like there is an issue with the type for freddoclist, because in the workspace it’s telling me that the type is "1×1 �", which seems wrong. I’m not sure why it’s suddenly creating this type, but I’m not sure how to fix it. Any ideas? Could I be missing a MATLAB application?I have some code that previously worked for me with MATLAB and FRED, but is now throwing me an error. Simply put, I’m trying to open a file in FRED using a MATLAB script. This code had worked before the CrowdStrike incident, but after the incident I needed to reset my computer and reinstall all applications, and I’m not sure if having a different version of MATLAB is throwing an error for this. For reference, I’m using MATLAB version R2024a and FRED version 22.40. I tried contacting FRED support about this, but they had no idea how to fix it and suggested I look for MATLAB support.
I’m running the following lines of code:
system(‘cd c:Program FilesPhoton EngineeringFRED 22.40.4Bin & start fred.exe’); pause(1)
fredsvr = actxserver(‘FRED.Application’); pause(0.1)
freddoclist = get(fredsvr,’Documents’); pause(0.1)
set(fredsvr,’Visible’, 1);
testdoc = ‘C:UsersUSERNAMEDocumentsTESTDOCUMENT.frd’;
freddoc = invoke(freddoclist,’Open’,testdoc); pause(0.5);
When I get to the last line I get a message telling me that there is an "Incorrect number or types of inputs or outputs for function invoke", which is an error I didn’t previously see when I ran the code and it worked (a few months ago). It seems like there is an issue with the type for freddoclist, because in the workspace it’s telling me that the type is "1×1 �", which seems wrong. I’m not sure why it’s suddenly creating this type, but I’m not sure how to fix it. Any ideas? Could I be missing a MATLAB application? I have some code that previously worked for me with MATLAB and FRED, but is now throwing me an error. Simply put, I’m trying to open a file in FRED using a MATLAB script. This code had worked before the CrowdStrike incident, but after the incident I needed to reset my computer and reinstall all applications, and I’m not sure if having a different version of MATLAB is throwing an error for this. For reference, I’m using MATLAB version R2024a and FRED version 22.40. I tried contacting FRED support about this, but they had no idea how to fix it and suggested I look for MATLAB support.
I’m running the following lines of code:
system(‘cd c:Program FilesPhoton EngineeringFRED 22.40.4Bin & start fred.exe’); pause(1)
fredsvr = actxserver(‘FRED.Application’); pause(0.1)
freddoclist = get(fredsvr,’Documents’); pause(0.1)
set(fredsvr,’Visible’, 1);
testdoc = ‘C:UsersUSERNAMEDocumentsTESTDOCUMENT.frd’;
freddoc = invoke(freddoclist,’Open’,testdoc); pause(0.5);
When I get to the last line I get a message telling me that there is an "Incorrect number or types of inputs or outputs for function invoke", which is an error I didn’t previously see when I ran the code and it worked (a few months ago). It seems like there is an issue with the type for freddoclist, because in the workspace it’s telling me that the type is "1×1 �", which seems wrong. I’m not sure why it’s suddenly creating this type, but I’m not sure how to fix it. Any ideas? Could I be missing a MATLAB application? fred, error, invoke, type MATLAB Answers — New Questions