how to code 2^3 full factorial with 16 runs

6 views (last 30 days)
catalina
catalina on 3 Mar 2024
Edited: catalina on 3 Mar 2024
EDIT: i solved it, i used this code to get the matrix i wanted which helped out with the plots as well
x = fullfact([2 2 2])
x = 8×3
1 1 1 2 1 1 1 2 1 2 2 1 1 1 2 2 1 2 1 2 2 2 2 2
a = repmat(x,2,1)
a = 16×3
1 1 1 2 1 1 1 2 1 2 2 1 1 1 2 2 1 2 1 2 2 2 2 2 1 1 1 2 1 1
d = [550 669 633 642 1037 749 1075 729 604 650 601 635 1052 868 1063 860]';
maineffectsplot(d,a,'varnames',{'gap','flow','power'})
interactionplot(d,a,'varnames',{'gap','flow','power'})
hi guys im trying to code a 2^3 full factorial and i know the code for it when it typically has 8 runs is this, as well as the code for the plots.
r = fullfact([2 2 2])
r = 8×3
1 1 1 2 1 1 1 2 1 2 2 1 1 1 2 2 1 2 1 2 2 2 2 2
d = [550 669 633 642 1037 749 1075 729;604 650 601 635 1052 868 1063 860]';
maineffectsplot(d,r,'varnames',{'gap','flow','power'})
interactionplot(d,r,'varnames',{'gap','flow','power'})
however, i noticed that the data i was given actually has 16 runs vs the regular 8. afaik we havent been taught a 2^3 fullfact without 8 runs, only 2^4 fullfact that has 16 runs, however, unless there is an option to simply make x123 the fourth factor, then im not sure how else to code this
this is the code i have for a 2^4 fullfact with 16 runs so you guys know what im talking about
l = fullfact([2 2 2 2])
l = 16×4
1 1 1 1 2 1 1 1 1 2 1 1 2 2 1 1 1 1 2 1 2 1 2 1 1 2 2 1 2 2 2 1 1 1 1 2 2 1 1 2
f = [45 71 48 65 68 60 80 65 43 100 45 104 75 86 70 96]';
maineffectsplot(f,l,'varnames',{'u','i','o','p'})
interactionplot(f,l,"varnames",{'u','i','o','p'})
im unable to get any plots with this, any ideas? main issue is the matrix, not quite sure how to do it as the question specified 2^3 full factorial

Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!