Weibull Fit for Dataset in Excel
Show older comments
trnSet = datastore("trainingSet.csv");
trnSet.ReadSize = 'file';
trnSet.TreatAsMissing = 'na';
trnSetR = read(trnSet);
coloumn = trnSetR.Properties.VariableNames;
trnSetR = table2array(trnSetR);
vec=zeros(1,height(trnSetR));
for k=1:height(trnSetR)
vec(1,k)=trnSetR(k);
end
[parmHat,parmCI] = wblfit(vec)
disp(parmHat);
How do I do a Weibull analysis of a data colomun with 60000 data sets?
Above is what I have so far, but it is giving me an error at vec=zeros(1,height(trnSetR));
3 Comments
Jeff Miller
on 1 Dec 2020
Looks like
trnSetR = table2array(trnSetR);
overwrites your original table with an array, and arrays don't have heights so the next line fails.
Vimal Rathod
on 3 Dec 2020
Could you specify what error did you get exactly? I think height function will work on arrays as well.
Nitya Sathish
on 3 Dec 2020
Answers (1)
Vimal Rathod
on 4 Dec 2020
Hi,
From 2020b MATLAB supports height function for arrays as well, but it seems like you are using a previous version so its better to use another alternative to height function for array that is size function.
vec=zeros(1,size(trnSetR,1));
Using this line will help you run your script.
Refer to the following link to know more about size function
1 Comment
Nitya Sathish
on 4 Dec 2020
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!