No output in the standalone executable matlab
Mostra commenti meno recenti
hello there,
I'm having a weird problem, I have written a code to calculate the volume by integration and made a gui to display the result
when I run the code and input the functions the when I press "calculate volume" as in the attached image the output appear with no problem
but when I use Matlab compiler to make a standalone app the pushbutton never work!!!
please I need an urgent help
note; every other pushbutton are working perfectly except "calculate volume"
here is the code
% --- Executes on button press in calc_vx.
function calc_vx_Callback(hObject, eventdata, handles)
% hObject handle to_x calc_vx (see GCBO)
% eventdata reserved - to_x be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
syms x
func_out =sym(get(handles.input_funcOutx, 'string'));
func_in =sym(get(handles.input_funcInx, 'string'));
axis_rotation = sym(get(handles.input_axisx, 'string'));
func_out1 = pi*(func_out - axis_rotation).^2;
func_in1 = pi*(func_in - axis_rotation).^2;
H=int((func_out1 - func_in1),x,str2double(get(handles.from_x, 'string')), str2double(get(handles.to_x, 'string')));
if (H) < 0
ed = errordlg('Reverse outer and inner functions since volume is negative','Error');
set(ed, 'WindowStyle', 'modal');
uiwait(ed);
else
set(handles.out_cal_vx, 'string', num2str(char(H)));
end
is there a problem with the compiler??
Risposta accettata
Più risposte (1)
Steven Lord
il 9 Giu 2019
Modificato: Steven Lord
il 9 Giu 2019
0 voti
Symbolic Math Toolbox is an ineligible product for MATLAB Compiler. As stated on that page, "this means that an application or component you deploy cannot use functionality from these products." The sym, syms, and int functions are part of Symbolic Math Toolbox and so will not work in a deployed application.
Depending on the specific expression you're trying to integrate, performing the integration before deploying your application and hard-coding the result in your code may be an option. Another potential option is to integrate numerically using the integral function, though if you do that you may need to be careful in creating the anonymous function you're going to pass into the integral function.
1 Commento
Anas Mustafa
il 9 Giu 2019
Categorie
Scopri di più su MATLAB Compiler in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!