## If statement using a vector

## If statement using a vector

(OP)

Hi Guys, I need to use an if statement and one of the inputs is a vector and I cannot get it to work.

I have an equation like this

Z:=if(C*D > min(A,B),min(A,B),C*D)

Where C and D are both vectors.

The message I get is that they need to be scalar quantities. I have tried converting A & B into vectors and using a basic program but no luck.

Any help would be appreciated.

Thanks

I have an equation like this

Z:=if(C*D > min(A,B),min(A,B),C*D)

Where C and D are both vectors.

The message I get is that they need to be scalar quantities. I have tried converting A & B into vectors and using a basic program but no luck.

Any help would be appreciated.

Thanks

## RE: If statement using a vector

## RE: If statement using a vector

## RE: If statement using a vector

I did discover that one of my values that I thought was a vector was actually a scalar number.I have a min function above comparing a fixed number and a vector and I had assumed (idiot) that it would have pulled down the vector.

I have tried multiplying the vector and scalar (creating another variable) previous to this function and using this in the if function but still no luck.

I have included a copy of my equation. Your help is greatly appreciated.

Thanks

## RE: If statement using a vector

Peter

## RE: If statement using a vector

You could use max(reinadd.n ⋅Heightrein.n) and compare this with max(A1.n ,A2.n). This will compare the highest value of the product (112.25 mm²) with the higher of A1.n and A2.n. Is this what you want?

## RE: If statement using a vector