How to solve : Undefined function 'rdivide' for input arguments of type 'matlab.ui​.control.N​umericEdit​Field'. Error?

21 visualizzazioni (ultimi 30 giorni)
Hello, I always get these 'matlab.ui.control.NumericEditField' errors with whatever code I run with. How to solve this "Undefined function 'rdivide' for input arguments of type 'matlab.ui.control.NumericEditField'." Error? I am quite new in this. Thanks in advance.
app.CL = app.CLEditField.Value; % Description
app.ks = app.ksEditField; % Description
app.k = app.kEditField; % Description
app.Beta0 = app.Beta0EditField.Value; % Description
app.cbyc = app.cbycEditField.Value; % c/c*
app.D = app.DEditField.Value; % Description
app.D50 = app.D50EditField.Value; % Description
app.rho = app.rhoEditField.Value; % Description
app.rhos = app.rhosEditField.Value; % Description
app.u = app.uEditField.Value; % Description
app.taubc = app.taubcEditField.Value; % Description
app.d = app.dEditField.Value; % Description
app.g = app.gEditField.Value; % Gravity
app.CbarL = app.CbarLEditField.Value; % C'L
app.E = app.EEditField.Value; % Description
app.Cc = app.CcEditField.Value; % Description
app.Bs = app.BsEditField.Value; % Basal's erosion, ξ
q =(log((0.35.*app.d)./app.ks)).^2;
x = [app.CL.*q./app.k]; %C'L =x, k =k2
z = sin(app.Beta0);
m = sqrt(x./(3*app.rhos));
v = 1- app.cbyc.*cos(app.Beta0);
app.E = [(z).*m.*(v)];
app.Cc = (26.53*(app.D.^(1/6)))/(app.D50^(1/6));
taubo= (app.rho*app.g*app.u^2)/(app.Cc.^2);
app.Bs = app.E*(1- (app.taubc/taubo))^(3/2).*(taubo).^(1/2);
app.CbarLEditField.Value = x;
app.EEditField.Value = app.E;
app.CcEditField.Value = app.Cc;
app.tauboEditField.Value = taubo;
app.BsEditField.Value = app.Bs;

Risposta accettata

Steven Lord
Steven Lord il 1 Nov 2021
You cannot perform arithmetic on an object handle. You will need to perform arithmetic on the Value property of that handle.
As an example, on this line of code:
q =(log((0.35.*app.d)./app.ks)).^2;
app.d is defined as the value of the edit field:
app.d = app.dEditField.Value; % Description
while app.ks is defined as the edit field itself:
app.ks = app.ksEditField; % Description
Try either changing app.ks to be app.ksEditField.Value (to match how app.d is defined) or change the line of code to use app.ks.Value.
  3 Commenti
Steven Lord
Steven Lord il 16 Nov 2021
Set a breakpoint on that last line of code. Run your code. When you reach the breakpoint, run this command:
whos Bs
I suspect Bs will be a double array, but it will not be a scalar. The Value of your edit field needs to be one number, not an array containing many numbers.
If you were expecting Bs to be a scalar, show us the sizes of the rest of the variables and we can try to help you determine how to make Bs a scalar.
whos
Mehbubul Haque
Mehbubul Haque il 17 Nov 2021
Hello, Thanks again. Yes, Bs is a double array. How can I display that in the app, edit field?
Below is just an example of how the answer comes.
Bs =
0.0000 - 5.3737i
>> whos Bs
Name Size Bytes Class Attributes
Bs 1x1 16 double complex

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by