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
d19a71ea
Commit
d19a71ea
authored
Mar 11, 2022
by
Jesper Andersson
Browse files
Fixed problem with long colormaps on recent Matlab versions
parent
5ad2bc2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
optimisation/OptPractical.m
View file @
d19a71ea
...
...
@@ -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