0

I have an equation r that I want to take in values from Ex and Vt. Ex and Vt give multiple values when run, but r does not. I need r to give values for each number in x1 and xL1.

Thanks.

Es= 1.01911;
Vab= 1.6;
s= 75.5;

x1= [93.5, 93.1, 92.0, 91.9, 92.2];
xL1= [49.0, 46.2, 48.6, 46.3, 48.9];

Ex= x1*(Vab/100);
Vt= Es*(xL1/s);
r=(20*(Ex-Vt))/Vt
3
  • I don't think this works. It is displaying a single value for r and the rest are the values for x1. Commented Mar 5, 2020 at 4:02
  • well first create 1 empty matrix of size 5. Commented Mar 5, 2020 at 4:10
  • Loop through the arrays Ex and Vt and set r. Set Ex and Vt to those arrays prior. Commented Mar 5, 2020 at 4:11

1 Answer 1

2

I think what you are after might be element-wise operation, i.e.,

r=(20*(Ex-Vt))./Vt

such that

r =

   25.237   27.773   24.877   27.055   24.699
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.