getting answers of an equation with 3 variables with known values

4 views (last 30 days)
I have the following equation,
function EI=GetEI(x)
I have the values of E1, E2 and E3, There are 12^3 (each E has 12 possible values) permutations and answers and I want to get all of the possible answers. I need help to write a code to get my values, can anyone help?
Thank you!
  1 Comment
John D'Errico
John D'Errico on 20 Feb 2021
Why not try a loop? Actually, try THREE nested loops. TRY SOMETHING. If you are a beginner, this is how you will learn. And if you make and show some effort, then you might get better help.

Sign in to comment.

Answers (1)

Viranch Patel
Viranch Patel on 9 Jul 2021
In general you can try like this.
If E1, E2, E3 are arrays of size 12, then
for i = 1:12
for j = 1:12
for k = 1:12
Feel free to checkout the documentation of MATLAB.


Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by