[MatLab] surf

thedarkhero
Il manuale della funzione SURF di matlab dice:

SURF 3-D colored surface.

SURF(X,Y,Z,C) plots the colored parametric surface defined by
four matrix arguments. The view point is specified by VIEW.
The axis labels are determined by the range of X, Y and Z,
or by the current setting of AXIS. The color scaling is determined
by the range of C, or by the current setting of CAXIS. The scaled
color values are used as indices into the current COLORMAP.
The shading model is set by SHADING.

SURF(X,Y,Z) uses C = Z, so color is proportional to surface height.

SURF(x,y,Z) and SURF(x,y,Z,C), with two vector arguments replacing
the first two matrix arguments, must have length(x) = n and
length(y) = m where [m,n] = size(Z). In this case, the vertices
of the surface patches are the triples (x(j), y(i), Z(i,j)).
Note that x corresponds to the columns of Z and y corresponds to
the rows.

Non mi è chiara una cosa...nel caso in cui i primi due parametri siano vettori la funzione SURF rappresenta una superficie passante per i punti $(x(i), y(j), Z(i,j))$, $1<=i<="length"(x)$, $1<=j<="length"(y)$; ma nel caso in cui i primi due parametri siano matrici?

Risposte
thedarkhero
Ho scoperto che si tratta della superficie passante per i punti $(X(i,j),Y(i,j),Z(i,j))$.

Ora però mi trovo davanti ad un altro problema relativo alla funzione SURF.
Come posso impostare il l'intervallo da rappresentare lungo l'asse Z? Ad esempio, vorrei che venissero visualizzati i valori da 0 a 10...

apatriarca
Non mi è chiaro cosa intendi, il range di valori che mostra è ovviamente quello della funzione presa in considerazione. Puoi però cambiare gli assi usando la funzione axis, oppure (se vuoi cambiare solo l'asse z) la funzione zlim.

thedarkhero
Intendevo esattamente quello che hai detto, ho risolto con zlim come mi hai consigliato, grazie! :)

Infine, è possibile unire più grafici ottenuti con SURF in un'unica finestra, un po come si fa con subplot?

apatriarca
Che io sappia, subplot funziona con qualsiasi tipo di grafico. Non c'è neanche bisogno che i grafici siano tutti dello stesso tipo.

thedarkhero
Hai ragione, grazie mille di tutto! :)

Rispondi
Per rispondere a questa discussione devi prima effettuare il login.