フィルターのクリア

if matlab does not signal me any error but in the .exe file does not work how can I write this code in another way?

1 回表示 (過去 30 日間)
How could I write this code in another way? Do you need the str2double? I put it to get the numerical value
function pushbutton3_Callback(~, ~, handles)
syms x %variable simbolica x
f=get(handles.edit8,'string');
xl=str2double(get(handles.edit3,'string'));
xu=str2double(get(handles.edit5,'string'));
tol=str2double(get(handles.edit4,'string'));
E=100;
xa=100;
i=0;
while(tol<E)
xr=(xl+xu)/2;
fxl=subs(f,x,xl);
fxr=subs(f,x,xr);
m=fxl*fxr;
if(m)<0
xu=xr;
else
xl=xr;
end
E=abs(xr-xa);
xa=xr;
i=i+1;
end
xr;
vpa(E,5)
set(handles.edit6,'string',xr);
set(handles.edit9,'string',E);
% --- Executes on button press in pushbutton4.

採用された回答

Steven Lord
Steven Lord 2017 年 11 月 6 日
You're using functions from Symbolic Math Toolbox (in particular syms, subs, and vpa.) Symbolic Math Toolbox is not eligible for use with MATLAB Compiler.

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 11 月 6 日
The cause of this is the same as https://www.mathworks.com/matlabcentral/answers/365294-does-my-code-have-an-error#answer_289606 . It even looks to me as if that is a duplicate question . Duplicate questions keep the volunteers spending time cleaning up questions instead of spending time answering the questions.
Not even a tiny bit of the Symbolic Toolbox can be compiled. The program will crash as soon as it encounters 'syms' or 'subs' or 'vpa'.
  1 件のコメント
Erwin Avendaño
Erwin Avendaño 2017 年 11 月 6 日
Ok, I understand, if I'm sorry it was a double question, I felt desperate to get an answer. So this code is not to make it executable? Okay, how could I make a code for an executable? Could you show me an example of how an executable code is?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by