Optimization Image Creation?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2017-10-8
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!