Borrar filtros
Borrar filtros

Optimization Image Creation?

1 visualización (últimos 30 días)
denis bertin
denis bertin el 8 de Oct. de 2017
Comentada: denis bertin el 8 de Oct. de 2017
Hi everybody, I want to know if it's possible to optimize(make faster upload image) this piece of code? or it is the top? Thank you.
tic
NP1=942;
t = linspace(0, 0.5/2500000, 2001);
A = load (strcat('cappellaingresso1', '_H.asc'));
d = 0.02*(NP1-1);
xx = linspace(0,d,NP1);
figure('visible','off');
h=imagesc(xx,t,A');
toc

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Oct. de 2017
There are some minor changes you can make.
When you pass x and y coordinates to imagesc then it ignores everything except for the first and last. That means there is no point computing anything except for the first and last, which saves you from using linspace since you already know the first and last from the linspace parameters.
There is a possibility that you might be able to read the data slightly faster if you already know the number of columns and you know the format of the entries, especially if you know the number of rows as well.
If you were loading images and displaying them many times then you could improve the graphics performance a bit.
  1 comentario
denis bertin
denis bertin el 8 de Oct. de 2017
the matrix is the 2001x942. Please can you write the optimal code?
thank you.

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by