You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
20 years old code
77 views (last 30 days)
Show older comments
I have a 20 years old code which starts the simulation using
OPTIONS=[1e-3,0.01,0.1,0,0,2];
euler('shuman',Ttotal,[],OPTIONS);
euler has since changed, how do I start it now? Also there is simver(1.3), anyone know what that means?
Thank you and kind regarsd,
Nilo
11 Comments
Harald
on 5 Feb 2026 at 15:11
Hi,
the only euler function I could find shipping with MATLAB returns Euler numbers or polynomials. The calling syntax suggests that the euler function in this case is a user-written one, possibly implementing Euler's method for solving ODEs.
It would be a matter of looking at the code of that euler function and possibly some trial-and-error to assist further. If you can find and provide it, also check if there is a shuman.m lurking around.
Best wishes,
Harald
Sam Chak
on 5 Feb 2026 at 15:27
Hi @Niloufar
Without additional context, we can only speculate. However, 'Shuman' may also refer to a specific filtering technique used in computational fluid dynamics (CFD).
This is another version of the euler() function, but it takes only two inputs:
function Y = euler(n, x)
% EULER Euler numbers and Euler polynomials.
% Y = EULER(N, X) is the N-th Euler polynomial.
% It is defined as
% euler(n, x) = subs(diff(2*exp(x*t)/(exp(t) + 1), t, n), t, 0)
% Y = EULER(N) is the N-th Euler number.
% It is defined as
% EULER(n) = 2^n*euler(n,1/2).
% See also BERNOULLI.
% Copyright 2013 The MathWorks, Inc.
The euler() function in your case could be a user-defined function designed to represent the Euler equation in fluid dynamics.
Niloufar
about 5 hours ago
function [ret,x0,str,ts,xts]=human(t,x,u,flag);
%HUMAN is the M-file description of the SIMULINK system named HUMAN.
% The block-diagram can be displayed by typing: HUMAN.
%
% SYS=HUMAN(T,X,U,FLAG) returns depending on FLAG certain
% system values given time point, T, current state vector, X,
% and input vector, U.
% FLAG is used to indicate the type of output to be returned in SYS.
%
% Setting FLAG=1 causes HUMAN to return state derivatives, FLAG=2
% discrete states, FLAG=3 system outputs and FLAG=4 next sample
% time. For more information and other options see SFUNC.
%
% Calling HUMAN with a FLAG of zero:
% [SIZES]=HUMAN([],[],[],0), returns a vector, SIZES, which
% contains the sizes of the state vector and other parameters.
% SIZES(1) number of states
% SIZES(2) number of discrete states
% SIZES(3) number of outputs
% SIZES(4) number of inputs
% SIZES(5) number of roots (currently unsupported)
% SIZES(6) direct feedthrough flag
% SIZES(7) number of sample times
%
% For the definition of other parameters in SIZES, see SFUNC.
% See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.
% Note: This M-file is only used for saving graphical information;
% after the model is loaded into memory an internal model
% representation is used.
% the system will take on the name of this mfile:
sys = mfilename;
new_system(sys)
simver(1.3)
...
--------------------
This is the beginning of the SHUMAN file.
euler is only called one more time as
set_param(sys,'algorithm', 'Euler')
In another file.
Thank you for your replies.
Kind regards,
Nilo
Niloufar
on 5 Feb 2026 at 16:04
Hi Harald,
>> which euler -all
C:\Program Files\MATLAB\R2023b\toolbox\symbolic\symbolic\@double\euler.m % double method
C:\Program Files\MATLAB\R2023b\toolbox\symbolic\symbolic\@single\euler.m % single method
C:\Program Files\MATLAB\R2023b\toolbox\symbolic\symbolic\@sym\euler.m % sym method
This is the output.
Kind regards,
Nilo
dpb
on 5 Feb 2026 at 16:11
That shows only what is presently installed with the 2023b MATLAB release; not what code was part of the 20-yr ago Simulink model. You'll have to find all the old original code from that time to have any chance or reinvent whatever it was that was being modelled.
dpb
on 5 Feb 2026 at 16:31
Edited: dpb
on 5 Feb 2026 at 16:51
No, it doesn't appear you do have all the original code; somewhere there was another user-supplied euier function besides Mathworks-suppled one. What, specifically, it did is anybody's guess depending upon what the model is of but it's a decent bet it was an implementation of Euler's method for ODEs.
Other than "20 years ago code" is there any chance you can find out what release was installed when this was last run succcessfully? You could then verify that there was no prior functionality that matched that footprint that has subsequently been removed.
Search FEX, maybe the developer picked up a submittal from there.
Steven Lord
on 5 Feb 2026 at 17:29
Do you have a Simulink model file for your system? If you do, what happens when you try opening it up in Simulink today? Does it know how to translate those very old pieces of infrastructure into the current Simulink architecture, does it throw errors, or does something else happen?
Niloufar
about 4 hours ago
Edited: dpb
27 minutes ago
They are Blocks written in .m file which after running them I assume, we have the block diagram in simulink.
How to run it I don't know, I have to redo it in the new simulink. If you have any suggestions, I'd be grateful.
I don't know when could it last run, I have to check.
Here an example of one Block
% Subsystem 'Block1'.
new_system([sys,'/','Block1'])
set_param([sys,'/','Block1'],'Location',[0,38,975,699])
add_block('built-in/From Workspace',[sys,'/','Block1/EXER_I'])
set_param([sys,'/','Block1/EXER_I'],...
'matl_expr','[texer;EXER]''',...
'position',[65,30,175,60])
add_block('built-in/Switch',[sys,'/','Block1/EXER_C'])
set_param([sys,'/','Block1/EXER_C'],...
'Threshold','0.5',...
'position',[745,94,775,136])
add_block('built-in/Transfer Fcn',[sys,'/','Block1/XERVMF'])
set_param([sys,'/','Block1/XERVMF'],...
'Denominator','[Txervm 1]',...
'position',[465,385,555,435])
add_block('built-in/Switch',[sys,'/','Block1/XERVM_C'])
set_param([sys,'/','Block1/XERVM_C'],...
'Threshold','0.5',...
'position',[745,367,775,413])
add_block('built-in/Switch',[sys,'/','Block1/VENTX_C'])
set_param([sys,'/','Block1/VENTX_C'],...
'Threshold','0.5',...
'position',[745,277,775,323])
add_block('built-in/Transfer Fcn',[sys,'/','Block1/VENTXF'])
set_param([sys,'/','Block1/VENTXF'],...
'Denominator','[Tventx 1]',...
'position',[460,295,555,345])
add_block('built-in/Transfer Fcn',[sys,'/','Block1/EXERA_F'])
set_param([sys,'/','Block1/EXERA_F'],...
'Denominator','[Texera2 1]',...
'position',[460,200,555,250])
add_block('built-in/Switch',[sys,'/','Block1/EXERA_C'])
set_param([sys,'/','Block1/EXERA_C'],...
'Threshold','0.5',...
'position',[745,182,775,228])
add_block('built-in/Look Up Table',[sys,'/','Block1/f(XERVMR)'])
set_param([sys,'/','Block1/f(XERVMR)'],...
'Input_Values','[0,1,3,10]',...
'Output_Values','[0,0.6,1,2.5]',...
'position',[510,93,540,117])
add_block('built-in/Look Up Table',[sys,'/','Block1/f(VENTXR)'])
set_param([sys,'/','Block1/f(VENTXR)'],...
'Input_Values','[0,2.5,10,20]',...
'Output_Values','[0,30,100,125]',...
'position',[510,43,540,67])
add_block('built-in/Transfer Fcn',[sys,'/','Block1/EXERA_I'])
set_param([sys,'/','Block1/EXERA_I'],...
'Denominator','[Texera1 1]',...
'position',[330,30,420,80])
add_block('built-in/Switch',[sys,'/','Block1/S4'])
set_param([sys,'/','Block1/S4'],...
'hide name',0,...
'Threshold','0.5',...
'position',[275,39,305,71])
add_block('built-in/Outport',[sys,'/','Block1/YCON7'])
set_param([sys,'/','Block1/YCON7'],...
'Port','5',...
'position',[845,565,865,585])
add_block('built-in/Logical Operator',[sys,'/','Block1/LO2'])
set_param([sys,'/','Block1/LO2'],...
'Operator','NOT',...
'Number of Input Ports','1',...
'position',[635,560,675,590])
add_block('built-in/Outport',[sys,'/','Block1/XERVM'])
set_param([sys,'/','Block1/XERVM'],...
'Port','4',...
'position',[845,380,865,400])
add_block('built-in/Outport',[sys,'/','Block1/VENTX'])
set_param([sys,'/','Block1/VENTX'],...
'Port','3',...
'position',[845,290,865,310])
add_block('built-in/Outport',[sys,'/','Block1/EXERA'])
set_param([sys,'/','Block1/EXERA'],...
'Port','2',...
'position',[845,195,865,215])
add_block('built-in/Outport',[sys,'/','Block1/EXERO'])
set_param([sys,'/','Block1/EXERO'],...
'position',[845,105,865,125])
add_block('built-in/Sum',[sys,'/','Block1/S1'])
set_param([sys,'/','Block1/S1'],...
'hide name',0,...
'inputs','+-',...
'position',[635,210,655,230])
add_block('built-in/Sum',[sys,'/','Block1/S2'])
set_param([sys,'/','Block1/S2'],...
'hide name',0,...
'inputs','+-',...
'position',[635,305,655,325])
add_block('built-in/Sum',[sys,'/','Block1/S3'])
set_param([sys,'/','Block1/S3'],...
'hide name',0,...
'inputs','+-',...
'position',[635,395,655,415])
add_block('built-in/Constant',[sys,'/','Block1/C5'])
set_param([sys,'/','Block1/C5'],...
'hide name',0,...
'Value','0',...
'position',[635,120,655,140])
add_block('built-in/To Workspace',[sys,'/','Block1/T'])
set_param([sys,'/','Block1/T'],...
'hide name',0,...
'mat-name','EXEROR',...
'buffer','10000',...
'position',[775,23,850,47])
add_block('built-in/Switch',[sys,'/','Block1/S7'])
set_param([sys,'/','Block1/S7'],...
'hide name',0,...
'Threshold','0.5',...
'position',[395,209,425,241])
add_block('built-in/Switch',[sys,'/','Block1/S6'])
set_param([sys,'/','Block1/S6'],...
'hide name',0,...
'Threshold','0.5',...
'position',[390,304,420,336])
add_block('built-in/Switch',[sys,'/','Block1/S5'])
set_param([sys,'/','Block1/S5'],...
'hide name',0,...
'Threshold','0.5',...
'position',[395,394,425,426])
add_block('built-in/Inport',[sys,'/','Block1/YC'])
set_param([sys,'/','Block1/YC'],...
'Port','4',...
'position',[40,390,60,410])
add_block('built-in/Inport',[sys,'/','Block1/Clk'])
set_param([sys,'/','Block1/Clk'],...
'Port','5',...
'position',[40,350,60,370])
add_block('built-in/Inport',[sys,'/','Block1/CORISW'])
set_param([sys,'/','Block1/CORISW'],...
'position',[40,225,60,245])
add_block('built-in/Inport',[sys,'/','Block1/PH'])
set_param([sys,'/','Block1/PH'],...
'Port','2',...
'position',[40,265,60,285])
add_block('built-in/Inport',[sys,'/','Block1/O2DEBT'])
set_param([sys,'/','Block1/O2DEBT'],...
'Port','3',...
'position',[40,310,60,330])
add_block('built-in/Fcn',[sys,'/','Block1/Fcn'])
set_param([sys,'/','Block1/Fcn'],...
'hide name',0,...
'Expr','u==1',...
'position',[110,225,195,245])
add_block('built-in/Fcn',[sys,'/','Block1/Fcn1'])
set_param([sys,'/','Block1/Fcn1'],...
'hide name',0,...
'Expr','u<=7',...
'position',[110,265,195,285])
add_block('built-in/Fcn',[sys,'/','Block1/Fcn2'])
set_param([sys,'/','Block1/Fcn2'],...
'hide name',0,...
'Expr','u>=10',...
'position',[110,310,195,330])
add_block('built-in/Fcn',[sys,'/','Block1/Fcn3'])
set_param([sys,'/','Block1/Fcn3'],...
'hide name',0,...
'Expr','u>=texer_ende',...
'position',[110,350,225,370])
add_block('built-in/Fcn',[sys,'/','Block1/Fcn4'])
set_param([sys,'/','Block1/Fcn4'],...
'hide name',0,...
'Expr','u==0',...
'position',[110,390,195,410])
add_block('built-in/Logical Operator',[sys,'/','Block1/LO1'])
set_param([sys,'/','Block1/LO1'],...
'Operator','NOR',...
'Number of Input Ports','5',...
'position',[285,266,325,374])
add_block('built-in/Constant',[sys,'/','Block1/C7'])
set_param([sys,'/','Block1/C7'],...
'hide name',0,...
'Value','0',...
'position',[290,205,320,225])
add_block('built-in/Outport',[sys,'/','Block1/YPS7'])
set_param([sys,'/','Block1/YPS7'],...
'Port','7',...
'position',[845,525,865,545])
add_block('built-in/Outport',[sys,'/','Block1/YCON8'])
set_param([sys,'/','Block1/YCON8'],...
'Port','6',...
'position',[845,480,865,500])
add_line([sys,'/','Block1'],[425,55;435,55;435,105;240,105;240,65;270,65])
add_line([sys,'/','Block1'],[780,390;840,390])
add_line([sys,'/','Block1'],[780,300;840,300])
add_line([sys,'/','Block1'],[780,205;840,205])
add_line([sys,'/','Block1'],[780,115;840,115])
add_line([sys,'/','Block1'],[425,55;505,55])
add_line([sys,'/','Block1'],[425,55;475,55;475,105;505,105])
add_line([sys,'/','Block1'],[200,320;280,320])
add_line([sys,'/','Block1'],[200,275;240,275;240,300;280,300])
add_line([sys,'/','Block1'],[200,235;250,235;250,280;280,280])
add_line([sys,'/','Block1'],[310,55;325,55])
add_line([sys,'/','Block1'],[560,225;630,225])
add_line([sys,'/','Block1'],[560,410;630,410])
add_line([sys,'/','Block1'],[560,320;630,320])
add_line([sys,'/','Block1'],[545,105;580,105;580,400;630,400])
add_line([sys,'/','Block1'],[660,315;740,315])
add_line([sys,'/','Block1'],[660,405;740,405])
add_line([sys,'/','Block1'],[660,130;740,130])
add_line([sys,'/','Block1'],[660,220;740,220])
add_line([sys,'/','Block1'],[330,320;345,320;345,115;230,115;230,55;270,55])
add_line([sys,'/','Block1'],[180,45;270,45])
add_line([sys,'/','Block1'],[230,45;230,25;685,25;685,100;740,100])
add_line([sys,'/','Block1'],[545,55;595,55;595,310;630,310])
add_line([sys,'/','Block1'],[65,235;105,235])
add_line([sys,'/','Block1'],[65,275;105,275])
add_line([sys,'/','Block1'],[65,320;105,320])
add_line([sys,'/','Block1'],[65,360;105,360])
add_line([sys,'/','Block1'],[230,360;240,360;240,340;280,340])
add_line([sys,'/','Block1'],[65,400;105,400])
add_line([sys,'/','Block1'],[200,400;250,400;250,360;280,360])
add_line([sys,'/','Block1'],[680,575;840,575])
add_line([sys,'/','Block1'],[580,375;740,375])
add_line([sys,'/','Block1'],[595,285;740,285])
add_line([sys,'/','Block1'],[425,55;435,55;435,190;740,190])
add_line([sys,'/','Block1'],[565,190;565,215;630,215])
add_line([sys,'/','Block1'],[435,55;435,35;770,35])
add_line([sys,'/','Block1'],[260,320;260,490;840,490])
add_line([sys,'/','Block1'],[580,375;350,375;350,420;390,420])
add_line([sys,'/','Block1'],[430,410;460,410])
add_line([sys,'/','Block1'],[345,225;390,225])
add_line([sys,'/','Block1'],[435,190;350,190;350,235;390,235])
add_line([sys,'/','Block1'],[595,285;350,285;350,330;385,330])
add_line([sys,'/','Block1'],[430,225;455,225])
add_line([sys,'/','Block1'],[425,320;455,320])
add_line([sys,'/','Block1'],[345,320;385,320])
add_line([sys,'/','Block1'],[345,320;345,410;390,410])
add_line([sys,'/','Block1'],[345,320;345,460;710,460;710,115;740,115])
add_line([sys,'/','Block1'],[710,205;740,205])
add_line([sys,'/','Block1'],[710,300;740,300])
add_line([sys,'/','Block1'],[710,390;740,390])
add_line([sys,'/','Block1'],[325,215;390,215])
add_line([sys,'/','Block1'],[360,215;360,400;390,400])
add_line([sys,'/','Block1'],[360,310;385,310])
add_line([sys,'/','Block1'],[345,320;345,575;630,575])
add_line([sys,'/','Block1'],[345,535;840,535])
dpb
about 6 hours ago
Edited: dpb
about 2 hours ago
That is clearly the output code from Simulink for a given model down to drawing the block diagram with the screen coordinates of the dsiplay at the time.
I have never seen a Simulink installation so "I know nuthink!" a la Sgt Schultz, but you might look at <Rebuild a Model> doc page and see if it helps...
Answers (0)
See Also
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)