I plot something using as basis two matrices built with meshgrid.
[U,V] = meshgrid(Y,X);
Inside a function I build another pair of matrices
[A,B] = function(input)
and therefore I plot
plot((U((length(U)+1)/2,:)),A((length(U)+1)/2,:));
plot((V((length(U)+1)/2,:)),B((length(U)+1)/2,:));
If U and V are of this kind:
U= 1 2 3 4 V= 1 1 1 1
1 2 3 4 2 2 2 2
1 2 3 4 3 3 3 3
... ...
I want to modify A in order to have the same plot but with U transposed meaning like this
U= 1 1 1 1 V= 1 2 3 4
2 2 2 2 1 2 3 4
3 3 3 3 1 2 3 4
... ...
Means that now U has fixed values along the rows and changes along the columns, I want to have fixed values along the columns and change along the rows and the mathematical way to do it is to transpose U.
Is there another way to do it or how can I modify A to get the same plot? Of course transposing A doesn't work. A is a built like the sum of four input parameters (input of the function)
A has let's say random values but the important thing is that the center row and column are approximately zero like this
A= -1.7 -1.6 ... 0 ... 1.6 1.7
-1.6 -1.5 ... 0 ... 1.5 1.6
... 0
0 0 0 0 0
...
1.6 1.5 ... 0 ... -1.5 -1.6
1.7 1.6 ... 0 ... -1.6 -1.7
U and V are of this kind
To get the same plot after transposing U and V is this way,
U=U'; V=V';
plot((V((length(U)+1)/2,:)),A((length(U)+1)/2,:));
plot((U((length(U)+1)/2,:)),B((length(U)+1)/2,:));
but I cannot use it because afterwards I write the values of A in a file.
plot((U(:,(length(U)+1)/2)),A((length(U)+1)/2,:));? - Adielplot((U((length(U)+1)/2,:)),A((length(U)+1)/2,:));works but as already says I use the plot to see if the result is correct but I would like to maintain the original code and act only on U, V, A and B. I mean keep everything like it is right now and modify just these four matrices because otherwise I'm not sure that the results are correct or not. - Shika93U). Why do you think that changing Y-axis data (A), in any case, should compensate the X-axis change...? That's two different independent things. - Adiel