-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored code a little. Plotted 3D derivative and checked it using …
…FEM. Everything is now OK.
- Loading branch information
1 parent
5809ac8
commit ba046c0
Showing
8 changed files
with
120 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function [ ] = plot_2D_scalar_and_grad( A, gradA ) | ||
|
||
xdim = size(A, 2); | ||
ydim = size(A, 1); | ||
|
||
Ap = A - min(A(:)); | ||
Ap = Ap / max(Ap(:)); | ||
d = ceil(xdim / 15); % decimation ratio | ||
imshow(repmat(Ap,1,1,3)); hold on; | ||
[V, U] = ndgrid(1:ydim, 1:xdim); colormap default; | ||
contour(U, V, Ap, 'LineWidth', 1.5); | ||
[V, U] = ndgrid(1:d:ydim, 1:d:xdim); | ||
quiver(U, V, squeeze(gradA(1,1:d:end,1:d:end)), squeeze(gradA(2,1:d:end,1:d:end))); | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function [ ] = plot_3D_scalar( noise ) | ||
|
||
noise = noise - min(noise(:)); | ||
noise = noise / max(noise(:)); | ||
h = contourslice(noise, [], [], [1,10,20,30], 16); | ||
set(h, 'LineWidth', 1.5); | ||
view(3); | ||
axis tight | ||
|
||
grid on; | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function [ ] = plot_3D_scalar_and_grad( noise, gradNoise ) | ||
|
||
xdim = size(noise, 3); | ||
ydim = size(noise, 2); | ||
zdim = size(noise, 1); | ||
|
||
nslices = 4; | ||
d = ceil(zdim / nslices); | ||
slices = 1:d:zdim; | ||
|
||
noise = noise - min(noise(:)); | ||
noise = noise / max(noise(:)); | ||
h = contourslice(noise, slices, [], [], 16); | ||
set(h, 'LineWidth', 1.5); | ||
view(3); | ||
axis tight | ||
grid on; | ||
hold on; | ||
|
||
d = ceil(xdim / 5); % decimation ratio | ||
gradNoise = gradNoise(:, slices, 1:d:end, 1:d:end); | ||
dX = squeeze(gradNoise(1,:,:,:)); | ||
dY = squeeze(gradNoise(2,:,:,:)); | ||
dZ = squeeze(gradNoise(3,:,:,:)); | ||
[D, V, U] = ndgrid(slices, 1:d:ydim, 1:d:xdim); | ||
quiver3(D, V, U, dX, dY, dZ); | ||
|
||
end | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters