Trying to create a button that Calculates and displays both sine and cosine of the angle. in app designer
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm trying to use the yc and ys fuctions to create a plot and display they're values in a text box.
% Button pushed function: ConfirmtheanswerButton
function ConfirmtheanswerButtonPushed(app, event)
degrees = app.EnterDegreesEditField.Value;
% creates the variable for degrees.
radians = degrees.*pi./180;
% Converts degrees to radians.
yc = cos(radians);
ys = sin(radians);
plot(app.UIAxes,yc);
plot(app.UIAxes_2,ys);
c = yc.^2 + ys.^2;
% Confirms that the radians from degrees conversion is correct
app.ConfirmationoftheanswerEditField.Value = c;
% sets the variable for the formula.
end
% Button pushed function: PlotSinCosButton
function PlotSinCosButtonPushed(app, event)
degrees = app.EnterDegreesEditField.Value;
% creates the variable for degrees.
radians = degrees.*pi./180;
% Converts degrees to radians.
yc = cos(radians);
ys = sin(radians);
plot(app.UIAxes,yc,'+');
plot(app.UIAxes_2,ys,'+');
yc = app.CosineoftheangleEditField.ValueDisplayFormat;
ys = app.SineoftheangleEditField.Value;
end
end
1 comentario
Image Analyst
el 24 de Mayo de 2020
Uh, OK. Do you have a question?
You didn't even attach your program.
Respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!