MATLAB Answers

0

shuftting graph plot matlab

Asked by Rashid Hussein on 11 Apr 2019
Latest activity Commented on by Adam Danz
on 11 Apr 2019
theta= inv(A)* S;
th=vec2mat(theta,19);
figure
mesh( th);

  1 Comment

Adam Danz
on 11 Apr 2019
The original question asked how to shift the x and y coordinates of a mesh plot produced by mesh(z).

Sign in to comment.

1 Answer

Answer by Adam Danz
on 11 Apr 2019
 Accepted Answer

mesh(Z) by itself uses the row and column index values of Z as the x and y coordinates. Your matrix is [9x19] so the x values are 1:9 and the y values are 1:19.
If you'd like to start at x=-4 and y=-9, you'll need to produce your own X and Y values using meshgrid().
[Xval, Yval] = meshgrid((1:size(th,2))-10, (1:size(th,1))-5); %shift x and y so they start at -4 and -9
figure
mesh(Xval, Yval, th);
190411 154709-Figure 1.jpg

  2 Comments

thankyou sir , thankyou so much from my heart
Adam Danz
on 11 Apr 2019
Any time!

Sign in to comment.