WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

Workspace-Variable in Funktion - Variablen austauschen

 

meisterlumpi
Forum-Newbie

Forum-Newbie


Beiträge: 1
Anmeldedatum: 01.03.11
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 01.03.2011, 22:09     Titel: Workspace-Variable in Funktion - Variablen austauschen
  Antworten mit Zitat      
Ich würde gerne eine Workspace Variable in einem Simulink Modell in einer Emb. Function benutzen. Die 2 Workspace Variablen sind 'F__1' und 'F__1'. Sie beinhalten Ausdrücke wie in den auskommentierten Zeilen F1 = -(100 ... und F2 = (100... . Dabei will ich die der Funktion übergebenen Variablen mit 'subs' in 'F__1' und 'F__2' ersetzten um dann einen numerischen Wert auszurechnen. Allerdings funktioniert das nicht so wie gewollt und matlab liefert mir folgenden fehler:
____
Command-duality is not supported.
Function 'fcn_force_lowerboom.m' (#91.563.629), line 14, column 1:
"syms GAMMA1 dGAMMA1 ddGAMMA1 GAMMA2 alpha1 alpha2 alpha11 alpha22;"
____

Wenn ich den Inhalt aus 'F__1' und 'F__2' per hand ins Skript kopiere funktionierts, dass sind die %%% Zeilen.

Danke schonmal für jegliche Hilfe

Code:

function [F1, F2] = fcn_force_LowerBoom(iGAMMA1, idGAMMA1, iddGAMMA1, iGAMMA2, ialpha1, ialpha2, ialpha11, ialpha22)
%#eml
syms GAMMA1 dGAMMA1 ddGAMMA1 GAMMA2 alpha1 alpha2 alpha11 alpha22;
eml.extrinsic('evalin');
F__1 = evalin('base','F__1')
F__2 = evalin('base','F__2')

%%% F1 = -(100*((26568027466859805131*ddGAMMA1)/22517998136852480 + (7078557563282365*sin(GAMMA1))/549755813888 + (1763091725074555*sin(alpha2))/137438953472 - (7295085214691217*cos(GAMMA2)^2*sin(alpha2))/68719476736 - (7295085214691217*sin(GAMMA2)^2*sin(alpha2))/68719476736 - (238160978872067801*ddGAMMA1*sin(alpha2))/109951162777600 - (3698546326815035*cos(GAMMA2)*sin(alpha22))/137438953472 - (3698546326815035*sin(GAMMA2)*cos(alpha22))/137438953472 + (5552717740573699272379*ddGAMMA1*cos(GAMMA2)*sin(alpha22))/2251799813685248000 + (5552717740573699272379*ddGAMMA1*sin(GAMMA2)*cos(alpha22))/2251799813685248000 + (3698546326815035*cos(GAMMA2)*sin(GAMMA1)*sin(alpha22))/137438953472 + (3698546326815035*sin(GAMMA1)*sin(GAMMA2)*cos(alpha22))/137438953472 - 7078557563282365/549755813888))/(209*sin(alpha2)*((209*cos(GAMMA2)*sin(alpha11))/100 - (209*sin(alpha1))/100 + (209*sin(GAMMA2)*cos(alpha11))/100));
%%% F2 = (100*((26568027466859805131*ddGAMMA1)/22517998136852480 + (7078557563282365*sin(GAMMA1))/549755813888 - 7078557563282365/549755813888))/(209*sin(alpha2));


F1 = subs(F__1, [GAMMA1, dGAMMA1, ddGAMMA1, GAMMA2, alpha1, alpha2, alpha11, alpha22], ...
          [iGAMMA1, idGAMMA1, iddGAMMA1, iGAMMA2, ialpha1, ialpha2, ialpha11, ialpha22]);
%%%F1 = subs(F__1, {GAMMA1, dGAMMA1, ddGAMMA1, GAMMA2, alpha1, alpha2, alpha11, alpha22}, ...
%%%          {iGAMMA1, idGAMMA1, iddGAMMA1, iGAMMA2, ialpha1, ialpha2, ialpha11, ialpha22});

F2 = subs(F__2, [GAMMA1, dGAMMA1, ddGAMMA1, GAMMA2, alpha1, alpha2, alpha11, alpha22], ...
          [iGAMMA1, idGAMMA1, iddGAMMA1, iGAMMA2, ialpha1, ialpha2, ialpha11, ialpha22]);
%%%F2 = subs(F__2, {GAMMA1, dGAMMA1, ddGAMMA1, GAMMA2, alpha1, alpha2, alpha11, alpha22}, ...
%%%          {iGAMMA1, idGAMMA1, iddGAMMA1, iGAMMA2, ialpha1, ialpha2, ialpha11, ialpha22});
 
Private Nachricht senden Benutzer-Profile anzeigen


Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2025 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.