Dot indexing is not supported error
7 views (last 30 days)
Show older comments
Hello, I am trying to run a function and I get this error 'Dot indexing is not supported for variables of this type'.
Here is the function and the error happens at the commented line.
% function [rc] = kat_meg_sng_parameters_script_20160614(CCid,onset_dir,output_dir,dotrans,owflag, doBlockBasedEstimation)
%
subdir = 'C:\Users\aninh\OneDrive - University of Cambridge\HRT project\';
output_dir = 'C:\Users\aninh\OneDrive - University of Cambridge\HRT project\test_output\';
matFileMask = 'blk*_event_times.mat';
matFilename = 'C:\Users\aninh\OneDrive - University of Cambridge\HRT project\HRT014\blk1_event_times.mat\';
%%ERROR HAPPENS HERE%% mat_files = rdir(fullfile(subdir,matFileMask)); mat_files = {mat_files.name}';
n = length(mat_files);
if( n == 0 )
Anyone knows how to solve this?
Many thanks!
0 Comments
Answers (1)
Simon Chan
on 20 Jan 2022
If there exist a variable name mat_files.name, you are not allowed to use another variable with name mat_files.
You may need to use another name or something like mat_files.newname.
0 Comments
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!