# How do I ajust the vallues the X-axis of a mesh (Z,Y,X) plot?

10 visualizzazioni (ultimi 30 giorni)
Tim van der Lans il 29 Set 2015
Commentato: Mike Garrity il 29 Set 2015
Hello,
I have a mesh(Z) plot that looks perfect, I just need to adjust the values of only the x axis (1 to 132) to (0.0216 to 0.9524 in 132 steps) I have put these new x-values in a 1 x 132 vector called Residue_ratio.
Any help? I tried using
mesh(z,,Residu_ratio)
but this seems to be wrong input arguments. I have also tried
set(gca,'XTick'
but matlab does not seem to recognize this code.
Thanks
Tim
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (2)

David Sanchez il 29 Set 2015
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
figure
mesh(Z)
xlabel('X')
x_ticks = linspace(0,40,41);
set(gca,'XTick',x_ticks)
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Walter Roberson il 29 Set 2015
mesh(Residue_ratio, 1:size(Z,2), Z)
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Mike Garrity il 29 Set 2015
That's correct. The mesh function wants either Z or X,Y,Z. It doesn't have an option where you can give an X & Z but omit the Y.

Accedi per commentare.

### Categorie

Scopri di più su Surface and Mesh Plots in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by