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

Funktion "sfunxy" anpassen.

 

Martin1986
Forum-Century

Forum-Century


Beiträge: 121
Anmeldedatum: 20.06.11
Wohnort: ---
Version: Win 2016b Linux 2016b
     Beitrag Verfasst am: 12.09.2011, 20:16     Titel: Funktion "sfunxy" anpassen.
  Antworten mit Zitat      
bis dato war ich ich immer der Meinung das ich es bin nun aber tendiere ich zu Matlab
ich wollte die funktion sfunxy anpassen
Code:
function FigHandle=CreateSfunXYFigure(block)

%
% the figure doesn't exist, create one
%
screenLoc = get(0,'ScreenSize');

if screenLoc(1) < 0
    left  = -screenLoc(1) + 100;
else
    left  = 100;
end

if screenLoc(2) < 0
    bottom = -screenLoc(2) + 100;
else
    bottom = 100;
end

FigHandle = figure('Units',          'pixel',...
                   'Position',       [left bottom  400 300],...
                   'Name',           BlockFigureTitle(block),...
                   'Tag',            'SIMULINK_XYGRAPH_FIGURE',...
                   'NumberTitle',    'off',...
                   'IntegerHandle',  'off',...
                   'Toolbar',        'none',...
                   'Menubar',        'none',...
                   'DeleteFcn',      'sfunxy([],[],[],''DeleteFigure'')');
%
% store the block's handle in the figure's UserData
%
ud.Block=block;

%
% create various objects in the figure
%
ud.XYAxes   = axes;
ud.XYLine   = plot(0,0,'EraseMode','None');
ud.XYXlabel = xlabel('X Axis');
ud.XYYlabel = ylabel('Y Axis');
ud.XYTitle  = get(ud.XYAxes,'Title');
ud.XData    = [];
ud.YData    = [];

%
% Associate the figure with the block, and set the figure's UserData.
%
SetSfunXYFigure(block,FigHandle);
set(FigHandle,'HandleVisibility','callback','UserData',ud);

so sieht das Original aus
wenn ich nun darauß
Code:
function FigHandle=CreateSfunXYFigure(block)

%
% the figure doesn't exist, create one
%
screenLoc = get(0,'ScreenSize');

if screenLoc(1) < 0
    left  = -screenLoc(1) + 100;
else
    left  = 100;
end

if screenLoc(2) < 0
    bottom = -screenLoc(2) + 100;
else
    bottom = 100;
end

FigHandle = figure('Units',          'pixel',...
                   'Position',       [left bottom  400 300],...
                   'Name',           BlockFigureTitle(block),...
                   'Tag',            'SIMULINK_XYGRAPH_FIGURE',...
                   'NumberTitle',    'off',...
                   'IntegerHandle',  'off',...
                   'Toolbar',        'none',...
                   'Menubar',        'none',...
                   'DeleteFcn',      'sfunxy([],[],[],''DeleteFigure'')');
%
% store the block's handle in the figure's UserData
%
ud.Block=block;

%
% create various objects in the figure
%
ud.XYAxes   = axes;
ud.XYLine   = plot(0,0,'EraseMode','None');
ud.XYLine1   = plot(ud.XYAxes,0,0,'EraseMode','None');
ud.XYXlabel = xlabel('X Axis');
ud.XYYlabel = ylabel('Y Axis');
ud.XYTitle  = get(ud.XYAxes,'Title');


%
% Associate the figure with the block, and set the figure's UserData.
%
SetSfunXYFigure(block,FigHandle);
set(FigHandle,'HandleVisibility','callback','UserData',ud);

mache dann stürzt das ab weil in SetSfunXYFigure
Code:
function SetSfunXYFigure(block,FigHandle)

if strcmp(get_param(bdroot,'BlockDiagramType'),'model'),
  if strcmp(get_param(block,'BlockType'),'S-Function'),
    block=get_param(block,'Parent');
  end

  set_param(block,'UserData',FigHandle);
end

der Blocktype Subsystem ist und nicht mehr S-Function ist, das ist mir ehrlich gesagt etwas hoch....

_Peter_: Bitte aussagekräftige Titel verwenden! Danke.
Private Nachricht senden Benutzer-Profile anzeigen


Martin1986
Themenstarter

Forum-Century

Forum-Century


Beiträge: 121
Anmeldedatum: 20.06.11
Wohnort: ---
Version: Win 2016b Linux 2016b
     Beitrag Verfasst am: 12.09.2011, 22:32     Titel: Also das mit dem Blockname habe ich noch weg bekommen
  Antworten mit Zitat      
aber er mag es trotzdem nicht
da er wegen Invalid handle object Problme hat ich bin echt etwas ratlos...
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.