Error "Undefined function 'min' for input arguments of type 'cell'. Error in wblplot (line 27) minx = min(sx(:));"
1 次查看(过去 30 天)
显示 更早的评论
I am making a GUI using App Designer to plot a weibull distribution plot and I used the "Text Area" that "allows multiline text entry", but I run the GUI and input (ie. breakdown time) the numbers in, the error "Undefined function 'min' for input arguments of type 'cell'. Error in wblplot (line 27) minx = min(sx(:));" showed up.
This is the function on which the error happens:
T1=(app.BreakdownTime1.Value);
T2=(app.BreakdownTime2.Value);
T3=(app.BreakdownTime3.Value);
T4=(app.BreakdownTime4.Value);
T5=(app.BreakdownTime5.Value);
T=[T1 T2 T3 T4 T5];
plot(app.wbldist,wblplot(T));
What does the error text mean and what should I do?
0 个评论
采纳的回答
Achyutha Hosahalli
2018-2-22
Hi Tsalsabilla !
Since you are using Text Area, its values would return the value which is of type cell array. But min function requires the data to be of type double. The easiest way would be to use Edit Field(numeric) to get the values and do the remaining stuff as you are doing. Edit Field(numeric) returns the value as type double. If you still want to use the Text Area and get it working, you can convert the data types of the values before you use it to plot.
For ex:
T1=str2double(char(app.BreakdownTime1.Value));
T2=str2double(char(app.BreakdownTime2.Value));
T3=str2double(char(app.BreakdownTime3.Value));
T4=str2double(char(app.BreakdownTime4.Value));
T5=str2double(char(app.BreakdownTime5.Value));
T=[T1 T2 T3 T4 T5];
plot(app.wbldist,wblplot(T));
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!