Dot indexing is not supported error

2 Ansichten (letzte 30 Tage)
Ana Maria Pereira de Souza
Ana Maria Pereira de Souza am 20 Jan. 2022
Beantwortet: Simon Chan am 20 Jan. 2022
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!

Antworten (1)

Simon Chan
Simon Chan am 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.

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by