Dot indexing not supported for variables of this type

1 次查看(过去 30 天)
Hi! I am trying to run code on a set of biological images to analyze sarcomere organization and length (the SOTA code is developed by the authors of the Sutcliffe et. al. 2018 paper, and is available for download on github: https://github.com/saucermanlab/SarcOrgTextureAnalysis ), however, I keep getting the error message "Dot indexing is not supported for varibales of this type." I am new to MATLAB and thus am not entirely sure how to solve this issue. Any help or suggestions are appreciated:) The error lies in the third and fourth line of the code, "[eX,eY] = beeswarmPoints([eCM.all.SarcomereOrganizationScore],xspacing,(ylimits(2)-ylimits(1))/nBins,ylimits);"
%% Sarcomere Organization
ylimits = [0 0.6];
xlimits = [0.25 2.75];
[eX,eY] = beeswarmPoints([eCM.all.SarcomereOrganizationScore],xspacing,(ylimits(2)-ylimits(1))/nBins,ylimits);
[rX,rY] = beeswarmPoints([rCM.all_aact.SarcomereOrganizationScore],xspacing,(ylimits(2)-ylimits(1))/nBins,ylimits);
figure('units','pixels','position',[50 500 figureSize]); hold on;
plot(xlimits,sarcomereOrganizationThreshold.*[1 1],'k--','LineWidth',lw);
scatter(eX+1,eY,markerSize,'MarkerEdgeColor',[1 1 1],'MarkerFaceColor',eCM_color,'MarkerFaceAlpha',alphaValue);
plot3Lines([eCM.all.SarcomereOrganizationScore],1,xwidth,lw);
scatter(rX+2,rY,markerSize,'MarkerEdgeColor',[1 1 1],'MarkerFaceColor',rCM_color,'MarkerFaceAlpha',alphaValue);
plot3Lines([rCM.all_aact.SarcomereOrganizationScore],2,xwidth,lw);
% plot([0.9 1.1],mean([eCM.all.SarcomereOrganizationScore])*[1 1],'k');
% plot([1.9 2.1],mean([rCM.all_aact.SarcomereOrganizationScore])*[1 1],'k');
set(gca,'FontSize',fontSize,'LineWidth',lw,'Color','None','TickDir','out','TickLength',[0.02 0.025]);
xlim(xlimits);
ylim(ylimits);
set(gca,'YTick',0:0.1:0.6);
ylabel('Sarcomere organization');
set(gca,'XTick',[1 2],'XTickLabel',xticklabels);
set(gca,'Position',gcaPosition);
ax = gca;
ax.XAxis.Color = 'k';
ax.YAxis.Color = 'k';
  2 个评论
Walter Roberson
Walter Roberson 2022-5-21
either eCM or eCM.all is not a struct and not an object.
When you see this message it is common to find that the entry is empty, [] because something failed.

请先登录,再进行评论。

回答(1 个)

prabhat kumar sharma
I understand that you are encountering an error with your code.
After cloning the repository and attempting to replicate the issue, I discovered that the variable eCM is a 1x1 struct. However, upon inspection, I found that eCM.all is empty (eCM.all = []). This is the reason for the error you are experiencing. The error occurs because there is no property named SarcomereOrganizationScore within the eCM.all struct.
To verify this, you can set the property SarcomereOrganizationScore before accessing it to avoid encountering this error. It is important to note that you cannot access a property that does not exist, which leads to the error in MATLAB.
If you have any further questions or need additional assistance, please let me know!
Tip: It’s always a good coding habit to null check the values before using.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by