Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

1 view (last 30 days)
fid = fopen('zaki_susu_preproc.txt','r'); %open file txt
C = textscan(fid,'%f%f%f%f');
fclose(fid);
YR = cell2mat(C); %ERROR
x1 = YR(:,2:2); %choose one column
fs = 250; %sampling freq
figure(1) %plot sinyal
plot(x1)
Unable to perform assignment because the indices on the left side
are not compatible with the size of the right side.
Error in cell2mat (line 46)
M(i,j) = C{i,j};
Error in coba1 (line 4)
YR = cell2mat(C);
  1 Comment
Image Analyst
Image Analyst on 24 Sep 2022
You forgot to attach 'zaki_susu_preproc.txt'! So what can we do?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 25 Sep 2022
Error in cell2mat (line 46)
M(i,j) = C{i,j};
That line of code does not exist in Mathworks cell2mat, at least not in 2019 or later. What shows up for
which -all cell2mat

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!