Optimization Image Creation?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Walter Roberson
le 8 Oct 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.
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!