How to load a batch file?

조회 수: 2 (최근 30일)
andrew
andrew 2013년 7월 15일
I have 2 questions first question. Right now i have a code that is a for loop:
filenames=cellstr(ls([Dir,'\*.mat*'])); %create a cell of all files in the directory named Dir containing the string '.mat' for j=1:length(filenames) % for loop to loop through each of the length(filenames) number of .mat files in Dir load(fullfile(Dir,filenames{j}),'percentiles'); %load the jth .mat file to the variable named percentiles. You can play with this variable like any other matlab variable. %The variable named 'percentiles' has 11 rows and two columns as described in the email filenames{j}%use curly brackets to print out the jth .mat file name from the cell matrix named 'filenames' percentiles;%print the contents of the variable named 'percentiles'
end
How do i have it open certain file names? Also how do you print 2 columns in one cell for example i have
1 2 2 4
and I would like it to be (1,2).

답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by