Function returning one value
Mostrar comentarios más antiguos
clear
clc
close all
x = linspace(-8, 8, 19);
y = (x.*((x.^2)-1)/((x.^2)+1).^2);
figure
plot(x, y)

Respuestas (1)
Ameer Hamza
el 5 de Dic. de 2020
Editada: Ameer Hamza
el 5 de Dic. de 2020
You need to use element-wise division
y = (x.*((x.^2)-1)./((x.^2)+1).^2);
%^ put a dot here
Read about element-wise operators here: https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html
2 comentarios
salar rohani nejad
el 5 de Dic. de 2020
Ameer Hamza
el 5 de Dic. de 2020
Editada: Ameer Hamza
el 5 de Dic. de 2020
I am glad to be of help!!!
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!