Dot indexing is not supported for variables of this type Error

1 Ansicht (letzte 30 Tage)
Chris Dan
Chris Dan am 18 Jan. 2020
Kommentiert: Voss am 17 Nov. 2022
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 Kommentare
Walter Roberson
Walter Roberson am 18 Jan. 2020
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 am 19 Jan. 2020
I dont understand what you are trying to say...
pic4.JPG
Thsi is my struct it should run, but it isnt....

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Harsha Priya Daggubati
Harsha Priya Daggubati am 29 Jan. 2020
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 Kommentare
Nomel Simmons
Nomel Simmons am 17 Nov. 2022
I am having this same exact error can someone please help its URGENT
Voss
Voss am 17 Nov. 2022
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.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by