comparison reshapeToPlotMatrix.m @ 832:5573913a0949 feature/burgers1d

Merged with default, and updated +scheme/Burgers1D accordingly
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 11 Sep 2018 15:58:35 +0200
parents 51aaf67a7df5
children
comparison
equal deleted inserted replaced
831:d0934d1143b7 832:5573913a0949
1 % Takes a grid function and reshapes it into a matrix of shape m for plotting.
2 function F = reshapeToPlotMatrix(gf, m)
3 D = length(m);
4
5 switch D
6 case 1
7 F = gf;
8 case 2
9 F = reshape(gf, rot90(m,2));
10 case 3
11 % After the reshape the indecies will be M(z,y,x). Plot need them to be M(y,x,z)
12 p = [2 3 1]; % Permuation
13 F = permute(reshape(gf,rot90(m,2)), p);
14 otherwise
15 error('reshapeToPlotMatrix:NotImplemented','Grid function to matrix is not implemented for dimension = %d', length(m));
16 end
17 end