How I can load multiple data files in workspace?

Hello, I have around 90 Data files that I want to use in my code.
How I can load and store these data files and store in different variables as in following order?
D1=load('Data1');D2=load('Data2');D3=load('Data3');D4=load('Data4');
D5=load('Data5');D6=load('Data6');D7=load('Data7');D8=load('Data8');
D9=load('Data9');D10=load('Data10');
D11=load('Data11');D12=load('Data12');D13=load('Data13');D14=load('Data14');
D15=load('Data15');D16=load('Data16');D17=load('Data17');D18=load('Data18');
D19=load('Data19');D20=load('Data20');

 채택된 답변

KSSV
KSSV 2022년 3월 5일
편집: KSSV 2022년 3월 5일

0 개 추천

files = dir('Data*') ; % you are in the folder of data files
N = length(files) ;
iwant = cell(N,1) ;
for i = 1:N
iwant{i} = load(files(i).name) ;
end

댓글 수: 1

Hi, can you tell me how i can access particular variable from this data?, because each of this data has struct having four members. now i want to get those values in each different variable from those structs as follows:
A1=D1.v_p_auswertung;A2=D2.v_p_auswertung;A3=D3.v_p_auswertung;
A4=D4.v_p_auswertung;A5=D5.v_p_auswertung;A6=D6.v_p_auswertung;
A7=D7.v_p_auswertung;A8=D8.v_p_auswertung;A9=D9.v_p_auswertung;
A10=D10.v_p_auswertung;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2022년 3월 5일

댓글:

2022년 3월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by