Do you have code to find the location of the zeros?
how can I display text of zero amplitude with text message
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have code below
t = -4:0.1:4;
y = t.^3-10*t;
plot(t,y)
when I run it the waveform displayed like below. how can I display the zero amplitude by using text command ?
Antworten (1)
Walter Roberson
am 26 Mär. 2023
After having found the places that are zeros and storing the x coordinates in List_of_XCoordinates_Of_Zeros then
for xcoord = reshape(List_of_XCoordinates_Of_Zeros,1,[])
text(xcoord, 0, "X = " + round(xcoord,2));
end
1 Kommentar
Walter Roberson
am 26 Mär. 2023
syms t
eqn = 3*t.^5-10*t^3+5;
List_of_XCoordinates_Of_Zeros = double(vpasolve(eqn));
List_of_XCoordinates_Of_Zeros(imag(List_of_XCoordinates_Of_Zeros) ~= 0) = [];
fplot(eqn, [-2 2])
for xcoord = reshape(List_of_XCoordinates_Of_Zeros,1,[])
text(xcoord, 0, "X = " + round(xcoord,2));
end
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!