write code to solve trigonometric equation
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello !
I am a begineer to matlab and i need to solve this trignometric equation using matlab graphically, could anyone help
func : cosh x cos x + 1
I tried to write the following code but it didn't work anymore
p= @(x) (cosh(x)*cos(x)+1);
x=[-2*pi:0.1:2*pi];
plot (x,p(x));
i tried to plot this equation with the given intervial but this message was shown "nonconformant arguments (op1 is 1x126, op2 is 1x126)
error: called from"
thanks
0 Kommentare
Akzeptierte Antwort
VBBV
am 29 Apr. 2023
p= @(x) (cosh(x).*cos(x)+1);
x=[-2*pi:0.1:2*pi];
plot(x,p(x));
3 Kommentare
Walter Roberson
am 29 Apr. 2023
p= @(x) (cosh(x).*cos(x)+1);
x=[-2*pi:0.1:2*pi];
px = p(x);
plot(x,px);
mask = find(px(1:end-1) .* px(2:end) <= 0);
[x(mask).', px(mask).', px(mask+1).']
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

