Dot indexing is not supported error

조회 수: 1 (최근 30일)
Ana Maria Pereira de Souza
Ana Maria Pereira de Souza 2022년 1월 20일
답변: Simon Chan 2022년 1월 20일
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!

답변 (1개)

Simon Chan
Simon Chan 2022년 1월 20일
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.

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by