Effacer les filtres
Effacer les filtres

why is plot from workspace(using load command ) is slow ?

1 vue (au cours des 30 derniers jours)
tomer polsky
tomer polsky le 24 Déc 2019
Commenté : tomer polsky le 24 Déc 2019
Hi I want to plot data from workspace (using the load command ) ,but for some reason the plot is very slow and then matlab gets stuck , why is that ?
I uploaded the workspace file,and the code I display here :
ADC_data_lim43=load('Data_Lim_43');
dec_limit=43;
f_RD_not=892.858e3;
real_data_ADC=ADC_data_lim43.real_data_ADC;
I_real=real_data_ADC*(19.6e-3)/(100*15e-3); %%real current
real_data_IN_driver=ADC_data_lim43.real_data_IN_driver; %% real gate signal
t=(1/f_RD_not)*(1:length(real_data_IN_driver)); %% time
figure(101);
plot(t,I_real,' red -- d ','linewidth',1); %% plot--> of I_real
hold on ;
plot(t,dec_limit*(19.6e-3)/(100*15e-3)*ones(size(t)),' black ','linewidth',3); %% plot--> of boundery limit
hold on ;
plot(t,100*(19.6e-3)/(100*15e-3)*real_data_IN_driver*ones(size(t)),' blue -- O ','linewidth',1); %% plot--> comperator output
title([' I_1(t) from ADC , Boundery Limit Current=' num2str(dec_limit*(19.6e-3)/(100*15e-3)) '[A]']);
ylabel('I[A]');xlabel('time[ mSec]');grid on;
legend ('I_{real}','boundery limit','comperator output');
xlim([ 0 t(end)]); %% limits of the x axis
xticks([0:0.0002:t(end)]); %% jumps of X axis
ylim([ 0 max(I_real)]); %% limits of the y axis
yticks([ 0:0.1:max(I_real)]); %% jumps of Y axis
I also tried using opengl command and changed Software option to 'true' (it was 'false') but now it works even worse ...

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Déc 2019
100*(19.6e-3)/(100*15e-3)*real_data_IN_driver*ones(size(t))
That code involves a 2040 x 1 matrix, and the * operator, and ones(size(t)) is 1 x 2040 . So you have (2040 x 1) * (1 x 2040) and the result of that is a 2040 x 2040 matrix. You are therefore asking MATLAB to plot 2040 lines of 2040 elements each.
  1 commentaire
tomer polsky
tomer polsky le 24 Déc 2019
oh right ... my bad , thank you for your help .

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by