IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MATLAB Discussion :

problème avec la Symbolic Math Toolbox ( apres building ) [Compiler]


Sujet :

MATLAB

  1. #1
    Candidat au Club
    Homme Profil pro
    Inscrit en
    Mars 2011
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mars 2011
    Messages : 6
    Points : 2
    Points
    2
    Par défaut problème avec la Symbolic Math Toolbox ( apres building )
    bjr/bsr à tous
    ..
    j'ai un grand problème avec MATLAB,
    ..
    j'ai créé un petit programme pour comprendre le problème ,

    et j'ai besoin que vous m'aidiez
    ..

    je vais laisser les photos parler par elle même

    1- avant building en " MATLAB GUI " il fonctionne très bien ..



    2- mais après building ,, voici le problème ?!!!!!!!!!



    ------------------------------------
    la source
    %----------------------------------
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    function pushbutton1_Callback(hObject, eventdata, handles)
    a = str2num(get(handles.a,'String'));
    x = a*5;
    set(handles.x,'String',x)
    %----------------------------------
    function pushbutton2_Callback(hObject, eventdata, handles)
    b = str2num(get(handles.b,'String'));
    syms z f
    f=5*z;
    y=subs(f,b);
    set(handles.y,'String',y)
    %----------------------------------
    voila le problème qui était affiché dans ms-dos

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ??? Undefined function or method 'syms' for input arguments of type 'char'.
     
    Error in ==> untitled>pushbutton2_Callback at 86
     
    Error in ==> gui_mainfcn at 96
     
    Error in ==> untitled at 42
     
    Error in ==>
    @(hObject,eventdata)untitled('pushbutton2_Callback',hObject,eventdata,guidata(hObject))
     
    ??? Error while evaluating uicontrol Callback
    --------------
    je pense que la fonction "syms" pose problème!! non ??..
    --------------
    et merci bcp pour touts ..

  2. #2
    Modérateur

    Homme Profil pro
    Ingénieur en calculs scientifiques
    Inscrit en
    Août 2007
    Messages
    4 639
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Ingénieur en calculs scientifiques

    Informations forums :
    Inscription : Août 2007
    Messages : 4 639
    Points : 7 614
    Points
    7 614
    Par défaut
    Bonjour,

    la toolbox symbolic math n'est pas supporte par le compiler (voir ici)
    Pour une bonne utilisation des balises code c'est ici!
    Petit guide du voyageur MATLABien : Le forum La faq Les tutoriels Les sources


    La nature est un livre écrit en langage mathématique. Galilée.

  3. #3
    Candidat au Club
    Homme Profil pro
    Inscrit en
    Mars 2011
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mars 2011
    Messages : 6
    Points : 2
    Points
    2
    Par défaut la solution !!
    merci pour la réponse
    mais comment résoudre le problème maintenant ? !!
    j'ai besoin d'une solution
    je vous remercie bcp ..

  4. #4
    Modérateur

    Homme Profil pro
    Ingénieur en calculs scientifiques
    Inscrit en
    Août 2007
    Messages
    4 639
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Ingénieur en calculs scientifiques

    Informations forums :
    Inscription : Août 2007
    Messages : 4 639
    Points : 7 614
    Points
    7 614
    Par défaut
    Désolé je ne connais pas de solution pour créer un exécutable utilisant la toolbox de calcul symbolique. Es-ce que tu dois obligatoirement utiliser cette toolbox?
    Pour une bonne utilisation des balises code c'est ici!
    Petit guide du voyageur MATLABien : Le forum La faq Les tutoriels Les sources


    La nature est un livre écrit en langage mathématique. Galilée.

  5. #5
    Candidat au Club
    Homme Profil pro
    Inscrit en
    Mars 2011
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mars 2011
    Messages : 6
    Points : 2
    Points
    2
    Par défaut !!
    oui c'est obligatoire ..
    le programme doit utiliser les symbolics "syms" , "sym" , "subs" et "plot" ... pour le calcul ..
    merci !

  6. #6
    Modérateur

    Homme Profil pro
    Ingénieur en calculs scientifiques
    Inscrit en
    Août 2007
    Messages
    4 639
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Ingénieur en calculs scientifiques

    Informations forums :
    Inscription : Août 2007
    Messages : 4 639
    Points : 7 614
    Points
    7 614
    Par défaut
    Peux-tu nous montrer ton code complet?
    Pour une bonne utilisation des balises code c'est ici!
    Petit guide du voyageur MATLABien : Le forum La faq Les tutoriels Les sources


    La nature est un livre écrit en langage mathématique. Galilée.

  7. #7
    Candidat au Club
    Homme Profil pro
    Inscrit en
    Mars 2011
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mars 2011
    Messages : 6
    Points : 2
    Points
    2
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    function varargout = untitled(varargin)
    % UNTITLED MATLAB code for untitled.fig
    %      UNTITLED, by itself, creates a new UNTITLED or raises the existing
    %      singleton*.
    %
    %      H = UNTITLED returns the handle to a new UNTITLED or the handle to
    %      the existing singleton*.
    %
    %      UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
    %      function named CALLBACK in UNTITLED.M with the given input arguments.
    %
    %      UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
    %      existing singleton*.  Starting from the left, property value pairs are
    %      applied to the GUI before untitled_OpeningFcn gets called.  An
    %      unrecognized property name or invalid value makes property application
    %      stop.  All inputs are passed to untitled_OpeningFcn via varargin.
    %
    %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
    %      instance to run (singleton)".
    %
    % See also: GUIDE, GUIDATA, GUIHANDLES
     
    % Edit the above text to modify the response to help untitled
     
    % Last Modified by GUIDE v2.5 24-Jan-2011 07:54:49
     
    % Begin initialization code - DO NOT EDIT
    gui_Singleton = 1;
    gui_State = struct('gui_Name',       mfilename, ...
                       'gui_Singleton',  gui_Singleton, ...
                       'gui_OpeningFcn', @untitled_OpeningFcn, ...
                       'gui_OutputFcn',  @untitled_OutputFcn, ...
                       'gui_LayoutFcn',  [] , ...
                       'gui_Callback',   []);
    if nargin && ischar(varargin{1})
        gui_State.gui_Callback = str2func(varargin{1});
    end
     
    if nargout
        [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
    else
        gui_mainfcn(gui_State, varargin{:});
    end
    % End initialization code - DO NOT EDIT
     
     
    % --- Executes just before untitled is made visible.
    function untitled_OpeningFcn(hObject, eventdata, handles, varargin)
    % This function has no output args, see OutputFcn.
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % varargin   command line arguments to untitled (see VARARGIN)
     
    % Choose default command line output for untitled
    handles.output = hObject;
     
    % Update handles structure
    guidata(hObject, handles);
     
    % UIWAIT makes untitled wait for user response (see UIRESUME)
    % uiwait(handles.figure1);
     
     
    % --- Outputs from this function are returned to the command line.
    function varargout = untitled_OutputFcn(hObject, eventdata, handles) 
    % varargout  cell array for returning output args (see VARARGOUT);
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Get default command line output from handles structure
    varargout{1} = handles.output;
     
     
    % --- Executes on button press in pushbutton1.
    function pushbutton1_Callback(hObject, eventdata, handles)
    a = str2num(get(handles.a,'String'));
    x = a*5;
    set(handles.x,'String',x)
     
     
    % --- Executes on button press in pushbutton2.
    function pushbutton2_Callback(hObject, eventdata, handles)
    b = str2num(get(handles.b,'String'));
    syms z f
    f=5*z;
    y=subs(f,b);
    set(handles.y,'String',y)
     
     
     
     
    function a_Callback(hObject, eventdata, handles)
    % hObject    handle to a (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of a as text
    %        str2double(get(hObject,'String')) returns contents of a as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function a_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to a (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function b_Callback(hObject, eventdata, handles)
    % hObject    handle to b (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of b as text
    %        str2double(get(hObject,'String')) returns contents of b as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function b_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to b (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end

  8. #8
    Rédacteur/Modérateur

    Avatar de Jerome Briot
    Homme Profil pro
    Freelance mécatronique - Conseil, conception et formation
    Inscrit en
    Novembre 2006
    Messages
    20 302
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance mécatronique - Conseil, conception et formation

    Informations forums :
    Inscription : Novembre 2006
    Messages : 20 302
    Points : 52 882
    Points
    52 882
    Par défaut
    Citation Envoyé par AkuX7 Voir le message
    oui c'est obligatoire ..
    le programme doit utiliser les symbolics "syms" , "sym" , "subs" et "plot" ... pour le calcul ..
    Comme magelan l'a dit plus tôt, les fonctions de la Symbolic Math Toolbox ne peuvent pas être compilées avec le MATLAB Compiler.
    A mon avis, mais je peux me tromper, cela vient du fait que cette toolbox est en fait le logiciel MuPAD.

    Donc dans ton cas, il te faut trouver une alternative aux fonctions SYMS et autres...

    Quel est l'importance du calcul formel dans ton application ?
    Ingénieur indépendant en mécatronique - Conseil, conception et formation
    • Conception mécanique (Autodesk Fusion 360)
    • Impression 3D (Ultimaker)
    • Développement informatique (Python, MATLAB, C)
    • Programmation de microcontrôleur (Microchip PIC, ESP32, Raspberry Pi, Arduino…)

    « J'étais le meilleur ami que le vieux Jim avait au monde. Il fallait choisir. J'ai réfléchi un moment, puis je me suis dit : "Tant pis ! J'irai en enfer" » (Saint Huck)

  9. #9
    Candidat au Club
    Homme Profil pro
    Inscrit en
    Mars 2011
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mars 2011
    Messages : 6
    Points : 2
    Points
    2
    Par défaut
    Citation Envoyé par Dut Voir le message
    Comme magelan l'a dit plus tôt, les fonctions de la Symbolic Math Toolbox ne peuvent pas être compilées avec le MATLAB Compiler.
    A mon avis, mais je peux me tromper, cela vient du fait que cette toolbox est en fait le logiciel MuPAD.

    Donc dans ton cas, il te faut trouver une alternative aux fonctions SYMS et autres...

    Quel est l'importance du calcul formel dans ton application ?
    ..
    j'ai fait un programme pour calculer la Matrice de rigidité globale [K] , la matrice de masse [M] et puis l'amortissement ( [C] = a [K] + b [M] ) ..
    et puis la résolution du système " [M] <U''> + [C] <U'> + [K] <U> = <F(t)> "
    ..
    pour calculer la matrice [K] c'est simple , c'est juste des calcules matriciels , je ne utilise pas les fonctions "syms" ... .
    mais pour la matrice de masse [M] il faut utiliser les fonctions comme "syms"
    voici une partie de la source pour calcul [M] ..
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    syms s n n1 n2 n3 N m M;
    n1=1-s-n;                                                            % Changement des variables x(s) ~ (s = Ksi)
    n2=s;                                                                %   //      //     //      y(n)
    n3=n;                                   
    N=[n1 0 n2 0 n3 0;0 n1 0 n2 0 n3]'*[n1 0 n2 0 n3 0;0 n1 0 n2 0 n3];  % Matrice d'interpolation N(s,n)
    M=zeros(2*nn,2*nn);
    for i=1:ne;
    xi(i)=e(i,1);
    yi(i)=e(i,2);
    xj(i)=e(i,3);
    yj(i)=e(i,4);
    xk(i)=e(i,5);
    yk(i)=e(i,6);
    ni(i)=e(i,7);
    nj(i)=e(i,8);
    nk(i)=e(i,9);
    rho(i)=e(i,12);                                                      % rho = Densité ( KN/m3 )
    j=(xj(i)-xi(i))*(yk(i)-yi(i))-(xk(i)-xi(i))*(yj(i)-yi(i));           % j = Jacobien
    m = ep*rho(i)*j*int(int(N, n, 0, 1-s),s, 0, 1);                      % m = Matrice de masse d'élément (i)
    M(2*ni(i)-1,2*ni(i)-1) = M(2*ni(i)-1,2*ni(i)-1) + m(1,1);            % M = Matrice de masse globale ( KN.s2/m )
    la fonction "syms" c'est très important pour calcul la masse [M] ..
    et c'est très très importante pour résoudre l'équation de mouvement ..
    SVP .. aidez moi
    et merci beaucoup à vous ..

  10. #10
    Candidat au Club
    Homme Profil pro
    Inscrit en
    Mars 2011
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Mars 2011
    Messages : 6
    Points : 2
    Points
    2
    Par défaut :ccool:
    en fin, j'ai trouvé la solution
    ..
    très simplement,
    j'ai calculer l'intégral en MATLAB et puis je remplacer la résultante dans ma fichier .m

    merci Dut et magelan pour votre réponse

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Symbolic Math Toolbox] simplification de fraction
    Par protos dans le forum MATLAB
    Réponses: 5
    Dernier message: 09/07/2019, 20h52
  2. Problème avec le Concepteur de vue après héritage
    Par Plio dans le forum VC++ .NET
    Réponses: 2
    Dernier message: 03/09/2008, 09h09
  3. problème avec la bib math.h
    Par tenderstoune dans le forum C++
    Réponses: 6
    Dernier message: 01/11/2007, 21h13
  4. [Symbolic Math Toolbox ] sym et double
    Par jbollagnier dans le forum MATLAB
    Réponses: 10
    Dernier message: 27/07/2007, 15h22
  5. Réponses: 4
    Dernier message: 16/04/2007, 16h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo