Skip to content

Commit 10609ac

Browse files
committed
Update README.md
1 parent 94d4602 commit 10609ac

File tree

2 files changed

+43
-42
lines changed

2 files changed

+43
-42
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Simscape Hybrid Electric Vehicle Project
1+
# Hybrid Electric Vehicle Model in Simscape(TM)
22

33
Version 1
44

@@ -17,7 +17,7 @@ individually and also they can be easily integrated into
1717
a complete vehicle system model.
1818

1919
The HEV model and its components are managed in
20-
a MATLAB Project and
20+
a MATLAB(R) project and
2121
some components come with their own test setups.
2222

2323
![Model Screenshot](utils/PowerSplitHEV_SpeedTracking.png)
@@ -26,10 +26,11 @@ some components come with their own test setups.
2626

2727
## Tool Requirements
2828

29-
Supported MATLAB Version: R2020b or newer releases
29+
Supported MATLAB version: R2020b or newer releases
3030

31-
Required: MATLAB, Simulink, Stateflow, Powertrain Blockset,
32-
Simscape, Simscape Driveline, Simscape Electrical
31+
Required: MATLAB, Simulink(R), Stateflow(R),
32+
Powertrain Blockset(TM),
33+
Simscape(TM), Simscape Driveline(TM), Simscape Electrical(TM)
3334

3435
## How to Use
3536

openFile.m

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
function openFile(filename)
2-
% Opens a script file or a model file in the project.
3-
% Before opening the file, this script opens the Project if not open.
4-
5-
% Copyright 2021 The MathWorks, inc.
6-
7-
arguments
8-
filename (1,1) string = "HEV_main_script.mlx"
9-
end
10-
11-
thisProjectFile = "HybridElectricVehicle.prj";
12-
thisProjectName = "Simscape Hybrid Electric Vehicle Model";
13-
14-
loaded = ~isempty(matlab.project.rootProject);
15-
if loaded
16-
currPrj = currentProject;
17-
if currPrj.Name ~= thisProjectName
18-
error(sprintf("This file must first load the project: " + thisProjectName + "\n" ...
19-
+ "But another project is currently open: " + currPrj.Name + "\n" ...
20-
+ "To use this file, please close the currenly open project."))
21-
end
22-
else
23-
disp("Opening project: " + thisProjectFile)
24-
openProject(thisProjectFile);
25-
end
26-
27-
if endsWith(filename, {'.m', '.mlx'})
28-
disp("Opening script: " + filename)
29-
edit(filename)
30-
elseif endsWith(filename, {'.slx', '.mdl'})
31-
disp("Opening model: " + filename)
32-
open_system(filename)
33-
else
34-
error('Unknown file type: %s', filename)
35-
end
36-
37-
end
1+
function openFile(filename)
2+
% Opens a script file or a model file in the project.
3+
% Before opening the file, this script opens the Project if not open.
4+
5+
% Copyright 2021 The MathWorks, inc.
6+
7+
arguments
8+
filename (1,1) string = "HEV_main_script.mlx"
9+
end
10+
11+
thisProjectFile = "HybridElectricVehicle.prj";
12+
thisProjectName = "Simscape Hybrid Electric Vehicle Model";
13+
14+
loaded = ~isempty(matlab.project.rootProject);
15+
if loaded
16+
currPrj = currentProject;
17+
if currPrj.Name ~= thisProjectName
18+
error(sprintf("This file must first load the project: " + thisProjectName + "\n" ...
19+
+ "But another project is currently open: " + currPrj.Name + "\n" ...
20+
+ "To use this file, please close the currenly open project."))
21+
end
22+
else
23+
disp("Opening project: " + thisProjectFile)
24+
openProject(thisProjectFile);
25+
end
26+
27+
if endsWith(filename, {'.m', '.mlx'})
28+
disp("Opening script: " + filename)
29+
edit(filename)
30+
elseif endsWith(filename, {'.slx', '.mdl'})
31+
disp("Opening model: " + filename)
32+
open_system(filename)
33+
else
34+
error('Unknown file type: %s', filename)
35+
end
36+
37+
end

0 commit comments

Comments
 (0)