Borrar filtros
Borrar filtros

Plots in a loop

2 visualizaciones (últimos 30 días)
Teshome Kumsa
Teshome Kumsa el 13 de Jul. de 2022
Respondida: Star Strider el 13 de Jul. de 2022
Assume I had a matrix of dimension nX20. I want to plot each column using a loop, but there is some problem in giving a title for each plot in a loop. I want to give the titles data1, data2 and so on for each plot. My loop looks like this:
figure(k)
surf(squeeze(X),squeeze(Y),reshape(data(:,k),size(squeeze(X))),'edgecolor','none')
view(2)
axis equal
axis tight
set(gcf,'renderer','painters')
title('data')
colorbar
end

Respuestas (1)

Star Strider
Star Strider el 13 de Jul. de 2022
Perhaps:
title(sprintf('data %3d',k))
.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by