How to correct this error?

In this above mentioned blog, it has the code of what i have done. In that code, the below mentioned code of lines when executed showed the error :
Attempt to reference field of non-structure array.
Error in @(x)length(x.freqSets)
Below is the mentioned code:
minSup = 0.6; % minimum support threshold 0.6
[F,S] = findFreqItemsets(transactions,minSup);
fprintf('Minimum Support : %.2f\n', minSup)
fprintf('Frequent Itemsets Found: %d\n', sum(arrayfun(@(x) length(x.freqSets), F)))
fprintf('Max Level Reached : %d-itemsets\n', length(F))
fprintf('Number of Support Data : %d\n', length(S))
I have created a file named findFreqItemsets in the same path, which includes the following code.
function [F,S,items] = findFreqItemsets(transactions,minSup,oneItemsets)
F = -999999; % Default to -999999.
S = -1; % Default to -1.
items = struct('freqSets', []);
Why i am getting this error? How will i correct this error?
Are u sure matlab is not compatible? But in this blog, it is said that it's a matlab code.

댓글 수: 1

PARVATHY P P
PARVATHY P P 2015년 12월 20일
Is there any way to work it with matlab?

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

답변 (1개)

Walter Roberson
Walter Roberson 2015년 12월 20일
편집: Walter Roberson 2015년 12월 20일

0 개 추천

Sorry, MATLAB is not compatible with what you want to do. You will need to write your own code in some other computer language.

댓글 수: 3

Walter Roberson
Walter Roberson 2015년 12월 20일
I did not say that the code in the blog is not MATLAB code: I said that MATLAB is not compatible with what you want to do. You want MATLAB to treat values as simultaneously being structures and non-structures. MATLAB is not able to do that. You will need to find a different programming language that implements RPM (Read Programmers Mind), or DWIWNWIS (Do What I Want Not What I Say).
... and please stop editing the question to make comments. Click on "Comment on this answer" instead.
PARVATHY P P
PARVATHY P P 2015년 12월 20일
So is there any way to find frequent itemsets with this matlab code in some way? I need this code to work with matlab.
PARVATHY P P
PARVATHY P P 2015년 12월 20일
편집: PARVATHY P P 2015년 12월 20일
I don't know how to find frequent itemsets from this transactions data, is there any other way to find this? Because i want the same thing that is actually given the blog to happen.

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

카테고리

도움말 센터File Exchange에서 Software Development Tools에 대해 자세히 알아보기

태그

질문:

2015년 12월 19일

다시 열림:

2015년 12월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by