Matrix dimensions must agree error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Shaunak Chandwadkar
am 7 Nov. 2016
Beantwortet: James Tursa
am 7 Nov. 2016
Hello, I have the following code and couldn't figure out what I am doing wrong. I am getting the following error,
Matrix dimensions must agree.
Error in trial_extracction (line 6)
if raw{k,1}=='Time, s'
[num,txt,raw] = xlsread('trial.xlsx');
i=1;
k=1;
j=1;
for k=1:1:(length(raw))
if raw{k,1}=='Time, s'
for j=k:1:(length(raw))
if raw{j,1}=='<END DATA>'
data=raw(k:(j-1),:);
name=strcat(i,'_All_indent.xls');
xlswrite(name, data, 1, A)
i=i+1;
end
end
end
end
0 Kommentare
Akzeptierte Antwort
James Tursa
am 7 Nov. 2016
Looks like you want to do a string compare in these lines:
if strcmp(raw{k,1},'Time, s')
:
if strcmp(raw{j,1},'<END DATA>')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!