Optimization Image Creation?

1 次查看(过去 30 天)
denis bertin
denis bertin 2017-10-8
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

回答(1 个)

Walter Roberson
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.
  1 个评论
denis bertin
denis bertin 2017-10-8
the matrix is the 2001x942. Please can you write the optimal code?
thank you.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by