'Value' must be a double scalar error?
Mostra commenti meno recenti
In my GUI I am trying to display some numerical values related to projectile motion. However, I keep getting the message, 'Value' must be a double scalar, when I try to display values for the range and the horizontal position at max height. Values for max height and flight time output just fine, and I cannot tell the difference between the type of values used in the equations. Furthermore, I have tried using the double command and the str2double command in attempts to change the value type, but neither are enabling me to display range or horizontal position values. What am I misunderstanding here?
Below is the relevant code:
gE = 9.81;
vix = v0*cosd(angle);
viy = v0*sind(angle);
hangtime1 = 2*viy/gE;
t1 = 0:hangtime1/50:hangtime1;
x1 = x0+vix.*t1;
maxheight1= y0 + (viy)^2./(2*gE);
xheight1 = x0 + vix.*(t1./2);
range1 = vix*t1;
r1 = double(range1);
% values I want to display; also want to include horizontal position, which is the variable xheight1
app.Hangtime.Value=hangtime1
app.MaxHeight.Value=maxheight1
app.Range.Value=r1
Thanks for your help out there!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!