strange cell array to matrix

[file,path]=uigetfile('*.csv','MultiSelect','on');
if ischar(file) % only 1 file selected
files={file};
end
File = fullfile(char(path),char(file));
I like normal x data and ydata in simple matrix form
[A1,delimiterOut,headerlinesOut] = importdata(File);

답변 (1개)

Mohammad Sami
Mohammad Sami 2020년 9월 18일
편집: Mohammad Sami 2020년 9월 18일

0 개 추천

Use the function readtable (or readmatrix) to load your file.
opts = delimitedTextImportOptions('NumVariables',2,'Delimiter',';','DataLines',5);
A1 = readtable(File,opts);

댓글 수: 2

venkat ta
venkat ta 2020년 9월 18일
seems delimitedTextImportOptions function isnot available at R2018a!
Mohammad Sami
Mohammad Sami 2020년 9월 18일
You can then replace it with detect import options function. https://www.mathworks.com/help/matlab/ref/detectimportoptions.html

이 질문은 마감되었습니다.

제품

릴리스

R2018a

태그

질문:

2020년 9월 17일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by