What happens is that my code uses Symbolic Math Toolbox and then making my guide executable the button that uses Symbolic Math Toolbox does not work, I had thought if using for example "syms, str2double, vpa" in my guide does not work because when executable do not know what to do if I could directly add the script of these, look in the matlab folder the vpa, str2double, syms script and I came up with my idea is to paste these scripts when I ask for the files my guide needs to start . It's okay?

 Respuesta aceptada

John D'Errico
John D'Errico el 7 de Nov. de 2017

0 votos

Sorry. You cannot copy parts of a toolbox into another directory and have those functions work properly.

5 comentarios

Erwin Avendaño
Erwin Avendaño el 7 de Nov. de 2017
What could I do? so
John D'Errico
John D'Errico el 7 de Nov. de 2017
Editada: John D'Errico el 7 de Nov. de 2017
I remember you now, after seeing your last question.
You are trying to use symbolic variables for what I would call silly purposes. (Actually, the word I thought of at the time was "insanity".) I'm sorry, but that is my firm opinion. I recall seeing your last question posted, and thinking how I was amazed that you felt you had to define symbolic variables to write a bisection code!
I don't know why you are trying to use those tools as you are. I will claim that you are going down the wrong road, making your code needlessly complicated.
It looks like you are trying to allow the user to provide input in the form of a function, but do so in a gui.
However, there is no need to create symbolic variables to work with a function, to create a function that can be evaluated. One option is to use an inline function, although inline may go away in some future release.
fstr = 'x^2';
F = inline(fstr)
F =
Inline function:
F(x) = x.^2
F(3)
ans =
9
But str2func exists, and will not disappear.
fstr = 'x^2';
F = str2func(['@(x) ',fstr]);
F(3)
ans =
9
So there are at least two options open to you that have no need at all to employ syms. Don't make your code needlessly complex.
Erwin Avendaño
Erwin Avendaño el 7 de Nov. de 2017
haha so I did and it worked before reading your comment so I did and it worked on my executable, thanks anyway
Erwin Avendaño
Erwin Avendaño el 7 de Nov. de 2017
for the case of newton raphson how could he do?
Erwin Avendaño
Erwin Avendaño el 7 de Nov. de 2017
I use diff to derive the function but the same is symbolic math toolbox so it does not work on my executable. What would I have to do?

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 7 de Nov. de 2017

0 votos

From Answers in the other post today, we know that you cannot compile an m-file into a standalone executable if it does anything with the symbolic toolbox. See if you can convert your problem into a numerical solution instead of a symbolic one.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Nov. de 2017

Comentada:

el 7 de Nov. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by