Reference to non-existent field - DBSCAN

Hi,
I'm trying to import data for DBSCAN clustering but i'm getting "Reference to non-existent field 'X'" error when i chnage the default dataset. I'm using the following code:
%%Load Data
data= load('BCW');
X= data.X;
% data = load('mydata') ;% default data works perfect
% X = data.X;
%%Run DBSCAN Clustering Algorithm
epsilon=0.5;
MinPts=10;
IDX=DBSCAN(X,epsilon,MinPts);
%%Plot Results
PlotClusterinResult(X, IDX);
title(['DBSCAN Clustering (\epsilon = ' num2str(epsilon) ', MinPts = ' num2str(MinPts) ')']);
Help please?

回答 (1 件)

Image Analyst
Image Analyst 2018 年 10 月 6 日

0 投票

This is probably a File Exchange submission. Since we don't have that code or BCW.mat file, and it's not a built in Mathworks function, I suggest you contact the author. If he doesn't answer, you'll have to debug it yourself after you read this: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/ or else attach the BCW.mat file. in the meantime, you can try this:
data = load('BCW') % DON'T USE A SEMICOLON
and tell us what you see in the command window.

3 件のコメント

Thouraya Aouled Messaoud
Thouraya Aouled Messaoud 2018 年 10 月 6 日
編集済み: Thouraya Aouled Messaoud 2018 年 10 月 6 日
Here is the BCW.mat file which i created my own (699x11 double) it contains the wisconsin original breast cancer dataset. The default data mydata.mat is also attached (1000*2 double). I tried as you said but I still get the error.
I will try to contact the author.
Image Analyst
Image Analyst 2018 年 10 月 6 日
OK, I'll do what I asked you to:
s = load('BCW.mat')
s =
struct with fields:
unnamed1: [699×11 double]
So, you see, there is a field named "unnamed1" but there is no field called "X".
Thouraya Aouled Messaoud
Thouraya Aouled Messaoud 2018 年 10 月 6 日
Yep that was it, Issue resolved.
Thanks a lot ;)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by