MATLAB Answers

Deploying Java Package error - Undefined function '​.text.inte​rnal.colle​ctOutput' for input arguments of type 'cell'.

5 views (last 30 days)
Tanmay Thakar
Tanmay Thakar on 1 Mar 2017
Commented: Tanmay Thakar on 7 Mar 2017
Hello , I am trying to use Hmm based Model in java application.
tmp_file1 = tempname(); % infile
tmp_file2 = tempname(); % outfile
dlmwrite(tmp_file1, [u, v], 'delimiter', ' ', 'precision', '%.6f');
[status,result] = system(['cs2cs ' prj4_params ' < ' tmp_file1 ' > ' tmp_file2]);
if status~=0
error(['Calling cs2cs: ' result]);
M = dlmread(tmp_file2);
x = M(:,1);
y = M(:,2);
x = reshape(x, nx, ny);
y = reshape(y, nx, ny);
Error in eclipse:
  • Error using dlmread (line 147) Undefined function '' for input arguments of type 'cell'.
  • Error in cs2cs (line 74)
  • Error in my_project (line 58)
It will be nice to help to overcome this issue because I have still other function from my Matlab project to use in my java application. I am trying to use whole Matlab project in java through jar (Matlab compiler SDK) so how to solve this type of error in future ?
I tried to add collectOutput.m into my project folder.


Sign in to comment.

Answers (1)

Nagarjuna Manchineni
Nagarjuna Manchineni on 6 Mar 2017
This behavior can occur if the MCR cache becomes corrupted in between two executions. To resolve this issue, you would need to delete the directory to which the CTF is extracted, so that it would be re-extracted with the next run of the application. This directory can be obtained by typing the following at the MATLAB Command Window:
>> mcrcachedir
If the above step did not fix the issue, can you try re-installing the required MATLAB Runtime version and also re-compile the .jar file using MATLAB Compiler SDK and use this updated jar file.
Also, try the following if the issue is happening with MATLAB.
1. Check if the function '' is on the MATLAB path
>> which -all
'' not found.
2. Since the above built-in function is not found, perform the following to restore path settings:
>> restoredefaultpath
>> rehash toolboxcache
>> savepath
3. Verify that the function is now on path:
>> which -all
MATLABROOT\toolbox\shared\io\+matlab\+io\+text\+internal\collectOutput.m % static method or package function

  1 Comment

Tanmay Thakar
Tanmay Thakar on 7 Mar 2017
Hey Thank You for your reply,
1) I tried to remove cache but it doesn't work (:
I want to mention something regarding the second option
1) I am working on two different computer one which has SDK is running on R2016a and where I am developing java application it has 2016b.
2) it's working fine on both Matlab version but when I tried which -all on R2016a it shows '' not found. but still working fine on Matlab. so is this creating the issue?
3) I saw that it require mcr9.0.1 but on the target machine, its shows mcrcache9.1 while I run the jar file in eclipse.
I am new to Matlab and I am having this issue from last one week so can help me out.
Thank you

Sign in to comment.

Sign in to answer this question.