# How to compare spec limit

3 Ansichten (letzte 30 Tage)
Kanakaiah Jakkula am 13 Mär. 2018
Kommentiert: KL am 13 Mär. 2018
Hi, Spec table: UL: upper limit, LL: Lower Limit
UL LL
V1 0.36 0.66
V2 30 50
V3 60 110
Actual:
V1 0.16
V2 3
V3 130
I want compare actual with spec limit,
1. If actual value <LL, adjust the actual value to LL
2. If actual value is >UL, adjust the actual value to UL
How to do this,
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Antworten (1)

KL am 13 Mär. 2018
Do it with a logical mask,
V1 = 0.16;
V1_LL = 0.36;
V1_UL = 0.66;
V1(V1<V1_LL) = V1_LL;
V1(V1>V1_UL) = V1_UL;
##### 2 KommentareKeine anzeigenKeine ausblenden
Kanakaiah Jakkula am 13 Mär. 2018
Sir,
If actual value is between LL & UL, then keep the acual value unchange.
Do I need to compare each variable one by one?
KL am 13 Mär. 2018
This should work even if V1 is a vector. As long as you have the same limits,
V1 = [0.36 0.46 0.56];
%and the same as above should work.
the values that are within the liimits will remain the same, that's the point, right?

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by