find result - Empty matrix: 0-by-1 - but it's wrong

1 vue (au cours des 30 derniers jours)
Céline Bachelier
Céline Bachelier le 15 Mai 2014
hello,
I have a problem with the 'find' command. this is my code:
ligne_journaliere = find (data_output_1(:,3)==2 & data_output_1(:,4)==3);
j = data_output_1(ligne_journaliere(1),4);
while data_output_1(ligne_journaliere,3)==2
figure('units','pixels','Position',[1 41 1600 784]);
[AX,h1,h2] = plotyy(timestamp(ligne_journaliere),sal(ligne_journaliere),timestamp(ligne_journaliere),lat(ligne_journaliere)'.');
set(h1,'linestyle','.','color','b','markersize',6);
set(h2,'linestyle','.','color',[0 0.8 0],'markersize',6);
datetick(AX(1));
datetick(AX(2));
hold on
grid on;
min_sal_jour = min(sal(ligne_journaliere));
max_sal_jour = max(sal(ligne_journaliere));
mois_du_jour = data_output_1(ligne_journaliere,3);
jour_du_jour = data_output_1(ligne_journaliere,4);
title(['Salinity - ',date_data,'/',num2str(mois_du_jour(1)),'/',num2str(jour_du_jour(1)),' - ', 'min sal = ',num2str(min_sal_jour),' - ','max sal = ',num2str(max_sal_jour)]);
xlabel('Time');
ylabel(AX(1),'Salinity');
ylabel(AX(2),'Latitude');
hgexport(gcf,[path_data_output,'MD_salinity_journaliere_',date_data,'_',num2str(mois_du_jour(1)),'_',num2str(jour_du_jour(1))],hgexport('factorystyle'),'Format', 'jpeg');
j = data_output_1(ligne_journaliere(end)+1,4);
ligne_journaliere = find (data_output_1(:,3)==2 & data_output_1(:,4)==j)
end
And 'ligne_journliere' just before the 'end' = Empty matrix: 0-by-1 when next j =j+2 and not j+1 ( j = days, but i don't have data everyday), and it's wrong find must return something.
I don't see the problem.
can you help me with that please. Céline

Réponse acceptée

Céline Bachelier
Céline Bachelier le 15 Mai 2014
I found my problem finally thanks

Plus de réponses (0)

Catégories

En savoir plus sur Logical 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!

Translated by