Matlab deployment with financial toolbox? - matlab

I am compiling a matlab code to exe and it has the uicalendar function in it. I did put the main app as my main .m file and in the setting I checked the financial toolbox.
The file compiled successfully and I can run the GUI but when I press the button that calls the uicalendar, the calendar will not show up.
Any idea ?
Thank you

According to this page, all GUI tools provided by the Financial toolbox (including uicalendar) are not supported by the MATLAB compiler for deployment.
Maybe you should search the File Exchange for an alternative...

Related

How to link MATLAB to Webots lib?

I created a MATLAB script for controller through wizards and uncommented
desktop; keyboard;
to interact with the MATLAB interface. Works are done on Win10.
My code works, but I have to start the MATLAB program from Webots to grant MATLAB access to Webots library. I tried opening MATLAB alone and had no clue about linking the program to Webots lib and project.
Another drawback is that every time I modify the codes and reset the simulation in Webots, MATLAB is restarted, which is annoying since it takes quite a time.
Q: Is there any way to link MATLAB to Webots lib so that I can develop the controller in MATLAB alone without starting Webots?
Maybe below solve your problem.
Solution
In the launcher.m file (..\Webots\lib\controller\matlab):
Change each line containing 'lib/matlab' to 'lib/controller/matlab'
Lines are 15, 23, 132
and
In allincludes.h (..\Webots\lib\controller\matlab):
Change each include path so that it goes back a further directory
eg: #include "../../../include/controller/c/webots/accelerometer.h"

How can I open multiple GUI in matlab packaged app

I have created a matlab program that contains multiple GUIs.
The way a call different GUIs from the main GUI is the following:
function button1_Callback(hObject, eventdata, handles)
close(main_GUI);
run GUI_1.m;
It works fine when the app is not packaged, but it gives me this error when the app is packaged using the matlab packaging application:
error using run
GUI_1.m not found
It looks like GUI_1.m file does't get included in the package, even when I add it manually from the packaging option.
Is it possible then to have different GUIs in a packaged matlab app? Thank you in advance

Matlab - import data tool

i have got a problem with the import data tool in matlab.
I just installed matlab this morning, at first it worked. However after shutting down the computer once, it doesn't work anymore.
More specifically, it opens and load data from .txt or spreadsheet, but when i click to import data to my workspace, instead of showing the progress in the waitbar it shows an error message:
IMPORT TOOL - couldn't find waitbar handles
any suggestion?
Sounds like the import tool works as intended until it cannot find the wait bar. A waitbar is a loading progress bar, which is available every basic installation of MATLAB (no toolbox required). Either the waitbar is created (do you see it?), but somehow not passed correctly through a broken connection between the import tool and the waitbar, or the waitbar function wasn't installed correctly.
I conclude your installation wasn't finished properly, so: uninstall MATLAB and reinstall it in one go (without pausing the installation).
You could also provide the system details you're installing on and the MATLAB version. Maybe someone knows of a certain condition of your particular setup that might cause the problem.

Installing add-ons without display

There are more and more packages on Matlab Central that are shared in the form of add-ons or custom toolboxes (extension .mltbx).
I'm using such toolboxes and when on my desktop I can simply install them by clicking on them. However my code is eventually deployed on a cluster, where none of the nodes has these toolboxes installed and none of the Matlab instance is run with display.
How can I install add-ons programmatically?
Poking around MATLAB's subroutines I couldn't figure out an obvious way to handle this programmatically without at least some user input.
That being said, the *.mltbx package is really just a *.zip file, which we can access directly inside MATLAB. To illustrate this, I've created a quick toolbox using my code prototyping folder, testcode-matlab.mltbx.
If you extract the contents of this file using unzip: unzip('testcode-matlab.mltbx', 'temp'); you should be left with something like the following:
If we examine the contents of fsroot, we see that it's the folder of data packaged into the toolbox:
So we can take this folder, move it to where we want using something like copyfile, and then add it to the MATLAB path using addpath:
copyfile('.\temp\fsroot', '.\mytoolboxes\testtoolbox');
addpath('.\mytoolboxes\testtoolbox');
As of R2016a, there is a MATLAB API to install them:
matlab.addons.toolbox.installToolbox('mytoolbox.mltbx')

How to debug Matlab/Simulink?

I have a Simulink model that uses an s_function, which is a mexw32 file. The s_function block uses a .lib module as well. Now, when I'm trying to run the model Matlab crash before the simulation end and without any errors in the command window. What are my options for debugging if Matlab crash?
This is typical behaviour of a badly written S-function that is causing a seg-fault. Debug it using the steps outlined at: http://www.mathworks.com/support/solutions/en/data/1-3KK6RK/
I dont know about Simulink or S-functions (never used them), but usually when a MEX-file segfaults, MATLAB will recover from it most of the times, showing a stack trace and placing you in the "you need to restart MATLAB" command prompt mode. You'll find a crash dump and error log files in the system %TMP% folder.
As other have said, if you have access to the source code of the MEX-function, recompile it with debugging symbols, attach a debugger to MATLAB, place breakpoints in the debugger, and initiate the MEX-function by calling it from MATLAB. Once inside the C code, debug it code step by step until you find the problem.
Here is the relevant doc page describing this process in more details.
You mentioned that your MEX-executable is linked against an external library. So you might also want to check that for the source of the problem.