delete the third dimension in 4D matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
M
am 21 Nov. 2023
Verschoben: Dyuman Joshi
am 21 Nov. 2023
I am trying to delete the third dimension in 4D matrix
the (HM_all_Train1) is structure 1*12 struct and contains 4D matrices with size 120*120*1*6000, I am trying to delete the 3d dimension as the following but I am still getting 4D
for i = 1:12
Heat_Map =HM_all_Train1(i)
Sqeezed_HM_Temp =Heat_Map(:,:,1,:);
Sqeezed_HM(i,1) = squeeze(Sqeezed_HM_Temp);
end
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 21 Nov. 2023
Verschoben: Dyuman Joshi
am 21 Nov. 2023
You are not accessing the data stored in the struct properly. You need to use the fieldname of the corresponding data to access the data.
An example would be -
for k=1:12
structurename(k).fieldnameof4Ddata = squeeze(structurename(k).fieldnameof4Ddata);
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Distribution Plots 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!