i have 4 .csvfiles imported into my code like this
Choice1= readtable ('computerchoice1.csv');
Choice2= readtable ('computerchoice2.csv');
Choice3= readtable ('computerchoice3.csv');
Choice4= readtable ('computerchoice4.csv');
how do i wirte code for it to randomly select one of them and to use with the rest of the code

 채택된 답변

KSSV
KSSV 2022년 1월 1일

0 개 추천

csvFiles = dir('*.csv');
N = length(csvFiles) ;
idx = randi(N,1) ;
csvFile = csvFiles(idx).name ;
T = readtable (csvFile);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

질문:

2022년 1월 1일

답변:

2022년 1월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by