Dot indexing is not supported for variables of this type Error

조회 수: 1 (최근 30일)
Chris Dan
Chris Dan 2020년 1월 18일
댓글: Voss 2022년 11월 17일
Hello,
I am trying to run this loop in a function
for i = 1:1:size(GlobalMeshonBody_1,1)
nE =size(GlobalMeshonBody_1(i).IndividualStiffnessMatrix,2);
end
and I am getting this error:
"Dot indexing is not supported for variables of this type."
But if I run the above loop in the main script, I get no errors at all...
The answer is get is
nE = 7;
Does anyone know?
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 1월 18일
Time to use the debugger
dbstop if error
then run the code. When it stops due to the error, examine class(GlobalMeshonBody_1)
Chris Dan
Chris Dan 2020년 1월 19일
I dont understand what you are trying to say...
pic4.JPG
Thsi is my struct it should run, but it isnt....

댓글을 달려면 로그인하십시오.

답변 (1개)

Harsha Priya Daggubati
Harsha Priya Daggubati 2020년 1월 29일
As mentioned in the comments, Can you put a breakpoint for the line where the error is being thrown.
Refer to this link and check if this helps:
  댓글 수: 2
Nomel Simmons
Nomel Simmons 2022년 11월 17일
I am having this same exact error can someone please help its URGENT
Voss
Voss 2022년 11월 17일
Since BW_mat comes from readmatrix(), BW_mat is a matrix. Therefore, try replacing "BW_mat.obj_matrix" with "BW_mat".
That is to say:
BW_mat = readmatrix('GestureU_Kalman.txt');
for jj = 1:size(BW_mat,3)
BW = BW_mat(:,:,jj);
s = regionprops(BW, 'centroids');
% etc.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by