find the right condition for my script
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Angela Marino
el 9 de Jul. de 2020
Editada: madhan ravi
el 9 de Jul. de 2020
Given the variables present in the .mat file, I need to find the values of the rows of the "distance" matrix (also using only the first column of values) in correspondence of which I have
in == 1
and
veloc == 0
This is how i wrote my code but i think i was wrong because i can't get the right result
r=0.007*ones(28,1);
[latc, lonc] = scircle1(lat_ferm(:,1), long_ferm(:,1), r);
for l=1:28
in = inpolygon(lat,lon,latc(:,l),lonc(:,l));
veloc_ferm=veloc(in);
idx=double(in(:,1));
%METTERE CONDIZONE SULLA VELOCITA'PER INIDIVIDUARE OPPORTUNAMENTE IDX
%E LA POSIZIONE DELLE FERMATE
[r c] = find(veloc(:,1)==0);
v = diff(r);
[r1 c3] = find(v > 1);
pos_fermateR2(:,1)=distanza(r(r1(in)));
end
2 comentarios
madhan ravi
el 9 de Jul. de 2020
Could you just illustrate with an example of 2x2 matrix and desired result?
Respuesta aceptada
madhan ravi
el 9 de Jul. de 2020
pos_fermateR2 = unique(distanza((in==1) & (veloc==0)))
5 comentarios
madhan ravi
el 9 de Jul. de 2020
Editada: madhan ravi
el 9 de Jul. de 2020
You maybe better off starting a new question.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!