Error: Dot indexing is not supported for variables of this type when initializing an array
이전 댓글 표시
When trying to initialize an array I get the following error:
Unable to perform assignment because dot indexing is not supported for variables of this type.
Error in PhaseAmplitudeCouple (line 300) Comodulogram.R = zeros(length(PhaseFreqVector),length(AmpFreqVector)); here is the relevant code:
PhaseFreqVector = 0:1:50;
AmpFreqVector = 0:5:200;
Comodulogram.R = single(zeros(length(PhaseFreqVector),length(AmpFreqVector)));
댓글 수: 4
Zach Ip
2018년 10월 10일
That's not how it works. If the name is empty, then yes, you will create a structure with a field R. If the name is already taken, then matlab will try to create a field to said variable. The problem is that the variable is a cell and cells have no field names, which explains your error message.
You cannot have a variable Comodulogram that is both a cell and a structure, they are different classes.
Anshuman Anshuman
2020년 11월 24일
I am getting the same error. I am trying to learn character recognition so I have found this code online and trying to run it but getting the error in the line axes(handles.axes6). can you help?
%% reading the image from the user
[filename, pathname] = ...
uigetfile({'*.jpg';'*.jpeg';'*.png';'*.*'},'Select Image File');
I=strcat(pathname,filename);
% figure(1);
%imshow(I);
axes(handles.axes6);% <----getting error here
imshow(I);
set(handles.pushbutton13,'Enable','on')
helpdlg('Image has been Loaded Successfully. Choose an algorithm and train the network ',...
'Load Image');
답변 (2개)
Jos (10584)
2018년 10월 10일
As described in the comments, this produces the same error:
A = {} ; % cell
A{1}.x = 1:10 % -> error!
% Unable to perform assignment because dot indexing is not supported for variables of this type.
The overcome this functionally, you can either delete the variable using clear, or overwrite the contents of the variable using the struct function, as in:
A = {}
A = struct('r',1:10) % overwrite
댓글 수: 2
kevin harianto
2022년 4월 6일
편집: Stephen23
2022년 4월 6일
Is there any ways to overwrite the contents in pointCloud inorder to meet the requirements for seeting up image?
error: Dot indexing is not supported for variables of this type.
image = ptcloud.Location;
I = helperPointCloudToImage(Location);
EDIT: Copyright code removed.
Stephen23
2022년 4월 6일
@kevin harianto: please do not post copyright code on this forum.
Vijay Khanijow
2021년 5월 4일
0 개 추천
I also get " dot indexing is not supported for this type of variable" when i submit code for lrCostFunction in Ex 3 of week 4 of Machine learning by Andrew Ng, Stanford. Any Help will be useful and appreciated.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!