i am trying to create a 3D matrices of total dose , energy and density distributions
The diemntion of the files are 1x9131020 ( all the files have similar dimentions )

댓글 수: 5

James Tursa
James Tursa 2021년 2월 9일
We need more details. Will you be reading multiple files (e.g., in a loop) and then concatenating the data into one 3D array? How are you reading the files?
the files are loaded using
clear
files = dir('fv*.asc');
numfiles = length(files);
for i=1:numfiles
load(files(i).name);
end
Walter Roberson
Walter Roberson 2021년 2월 9일
You might not see the relevance of that immediately, but the way you are using load() is creating variable names dynamically, and you would have to fish through the workspace to find out which variable names were created in order to know which variables to concenate together into the 3D array. Easier by far to Not Do That.
Ahmad Abbas
Ahmad Abbas 2021년 2월 9일
i know it is not the best way to load the files dynamically but i only got three files.
Stephen23
Stephen23 2021년 2월 9일
"... but i only got three files."
It is not important how many files you have. Load them into an output:
S = load(..)
and process the content of the structure S.

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

 채택된 답변

Anshika Chaurasia
Anshika Chaurasia 2021년 2월 11일

0 개 추천

Hi Ahmad,
You can refer to cat documentation that will concatenate arrays.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by