Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Saad Jbabdi
GradProg-Advanced-Analysis
Commits
31095c45
Commit
31095c45
authored
Mar 11, 2022
by
Saad Jbabdi
Browse files
Merge branch 'jesper' into 'master'
Fixed problem with long colormaps on recent Matlab versions See merge request
!10
parents
5ad2bc2c
d19a71ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
optimisation/OptPractical.m
View file @
31095c45
...
...
@@ -26,6 +26,7 @@
[
x
,
y
]
=
ndgrid
(
-
1.5
:
0.05
:
2
,
-
1
:
0.05
:
3
);
% Grid on which to calculate function
rosen
=
(
1
-
x
)
.^
2
+
100
*
(
y
-
x
.^
2
)
.^
2
;
% Function values on grid
figure
(
'Position'
,[
100
100
800
800
]);
colormap
(
jet
(
64
));
surfc
(
x
,
y
,
rosen
,
'EdgeColor'
,[
.
5
.
5
.
5
]);
xlabel
(
'x'
);
ylabel
(
'y'
);
...
...
@@ -190,6 +191,7 @@ refresh_rosenbrock(x,y,lcm,pp);
z
=
3
*
(
1
-
x
)
.^
2
.*
exp
(
-
(
x
.^
2
)
-
(
y
+
1
)
.^
2
)
-
10
*
(
x
/
5
-
x
.^
3
-
y
.^
5
)
.*
exp
(
-
x
.^
2
-
y
.^
2
)
-
1
/
3
*
exp
(
-
(
x
+
1
)
.^
2
-
y
.^
2
);
figure
(
'Position'
,[
100
100
800
800
]);
colormap
(
jet
(
64
));
surfc
(
x
,
y
,
z
,
'EdgeColor'
,[
.
5
.
5
.
5
]);
xlabel
(
'x'
);
ylabel
(
'y'
);
...
...
@@ -422,6 +424,7 @@ for i=1:size(beta1,1)
end
end
figure
(
'Position'
,[
100
100
800
800
]);
colormap
(
jet
(
64
));
surfc
(
beta1
,
beta2
,
sse
,
'EdgeColor'
,[
.
5
.
5
.
5
]);
xlabel
(
'b1'
);
ylabel
(
'b2'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment