Application Compiler One or More feature 'MRC' resulted in Error

I am getting error when I compile the my code for Application Compiler ( Standalone )
Below is my code . It runs fine but throws error when i run the MRC *.exe. Below is my code
I get the error string for "Content = fetchOutputs(Content); ". I have added picture for the error message.

 Accepted Answer

When I copy your code into an m file, I instantly see an error at this line. I assume you're getting that error, too.
function WorkingDir = getcurrentdir
If you are treating this file as a function file, either all or none of the functions must end with an end. However, it seems that startupfcn() is the main function and the other functions are nested. In that case, none of the functions need an end.
For more info on function files, local functions, and nested function, https://www.mathworks.com/help/matlab/matlab_prog/types-of-functions.html
Additionally, the function getcurrentdir() probably should have an underscore to match the function call. get_currentdir().

10 Comments

Actually, the end keyword is optional for functions (in my opinion, it's a bad coding style). GUIDE generates code without function end. However, if one function in a file has an end, then all functions must have an end.
Thanks, Guillaume. I clarified it, "..either all or none of the functions must end with an end"
Thanks a lot for the feedback and help
When I copy your code into an m file, I instantly see an error at this line. I assume you're getting that error, too.
The problem was in input while adding the question ( my mistake)
Please find the attachment . Attachment has 3 folder
1 Input : containing result data files. Provide the path to the result folder if we run the code from the matlab editor ( F5)
2 mfile : contains mfile to analyze the result file.
3 Standalone_app: contain *.mlapp file for gui control
Problem : start the startupfcn.exe and locate the folder /../../MathWorks/input/
- select the folder test_that_results_hatch_S2V2DS
- Please see the error- screen shot added in the folder
The goal is to generate successful distribution
- for_testing
- for_redistribution_files_only
- for_redistribution
I am facing issue when startupfcn.exe is executed (generated from the standalone compiler)
I don't see "Content" is passed to the function get_fieldnames(Content) as an input argument because Content was NOT return successfully from the get_test_that() which was called from get_Searchforfile.
When I run your code from matlab (not from an exe) I do not get that error (copied from your zip file, below).
In get_Searchforfile(), the output Content is only defined if at least one of the many conditionals are met. On possibility is that Content is never defined because the inputs never meet any of the conditional requirements. To investigate what set of inputs may lead to this problem, you could do the following.
  1. Toward the top of get_Searchforfile, initialize Content as empty: Content = [];
  2. At the end of get_Searchforfile, add the following conditional that will print the inputs if Content is not defined.
if isempty(Content)
% This will pass the 2 inputs to the base workspace
% where you can explore the inputs.
assignin('base','Param_Target',Param_Target)
assignin('base','Files',Files)
error('Aborted')
end
Thanks Adam!!
I think the problem is with
function WorkingDir = get_currentdir()
if isdeployed % Stand-alone mode.
% [status, result] = system('path');
[result] = uigetdir();
sprintf('Your folder is %s', result);
WorkingDir = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
else % MATLAB mode.
WorkingDir = uigetdir();
end
When startupfcn.exe is executed the uigetdir() directory does not work any more...
What i see the Copyfile folder is generated in the "for_testing" i.e. it' self generated ( This is unexpected )where it is collecting the Renamefile .
Copyfile is the folder is expected to be generated at Result folder "test_that_results_hatch_S2V2DS"
Can you please give me the right implementation when Standalone Compiler is used to generate the *.exe.
Thank you!!
Mine is R2019b..
I will try.Thank you!!
I just place uigetdir.m in the same directory as the main file. It works great!!
Super help. Thanks a lot Adam.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!