現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
20 years old code
80 ビュー (過去 30 日間)
古いコメントを表示
Niloufar
2026 年 2 月 5 日 14:35
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 件のコメント
Harald
2026 年 2 月 5 日 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
2026 年 2 月 5 日 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
2026 年 2 月 5 日 15:32
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
Harald
2026 年 2 月 5 日 15:52
Hi Nilo,
Is there an euler.m associated with the project?
If you are not sure, this would be displayed when running
which euler -all
Best wishes,
Harald
Niloufar
2026 年 2 月 5 日 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
2026 年 2 月 5 日 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.
Niloufar
2026 年 2 月 5 日 16:18
I have all of the code, could it be in eariler version it meant something else.
dpb
2026 年 2 月 5 日 16:31
編集済み: dpb
2026 年 2 月 5 日 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
2026 年 2 月 5 日 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
2026 年 2 月 6 日 10:26
編集済み: dpb
2026 年 2 月 6 日 14:05
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
2026 年 2 月 6 日 15:57
編集済み: dpb
2026 年 2 月 6 日 19:35
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...
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Programmatic Model Editing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
