# how can I delete the related raw in B?

2 visualizzazioni (ultimi 30 giorni)
maha arcc il 29 Feb 2016
Modificato: Mohammad Abouali il 29 Feb 2016
There are two matrix A&B each with two columns The first columns of A is the number of instrument and the second is its accuracy arranged by the value of the accuracy . the smallest accuracy is the first raw and so on , the last raw is the biggest accuracy. A=(3,0.003;1,0.025;2,0.03) If the first column of B is the number of instrument and the second is its measurement arranged ascending by the number of instrument B=(1,75;2,102;3,63) The sequence is: making some calculations, get matrix A, delete the instrument With high accuracy(always last raw, in my example: [2 0.03]), go to matrix B and delete the raw related to the number of instrument ‘2’ which is [2 102] > rej_inst_raw=A(end,:) ; > A(end,:)=[]
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Mohammad Abouali il 29 Feb 2016
Modificato: Mohammad Abouali il 29 Feb 2016
A=[3,0.003;1,0.025;2,0.03]
A =
3 0.003
1 0.025
2 0.03
B=[1,75;2,102;3,63]
B =
1 75
2 102
3 63
% Removing the row from B that relates to last row of A
B=B( B(:,1)~=A(end,1),:)
B =
1 75
3 63
%Removing last row of A
A=A(1:end-1,:)
A =
3 0.003
1 0.025
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Instrument Control Toolbox in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by