Function returning one value

19 visualizzazioni (ultimi 30 giorni)
salar rohani nejad
salar rohani nejad il 5 Dic 2020
Modificato: Ameer Hamza il 5 Dic 2020
clear
clc
close all
x = linspace(-8, 8, 19);
y = (x.*((x.^2)-1)/((x.^2)+1).^2);
figure
plot(x, y)

Risposte (1)

Ameer Hamza
Ameer Hamza il 5 Dic 2020
Modificato: Ameer Hamza il 5 Dic 2020
You need to use element-wise division
y = (x.*((x.^2)-1)./((x.^2)+1).^2);
%^ put a dot here
  2 Commenti
salar rohani nejad
salar rohani nejad il 5 Dic 2020
thank you so much
Ameer Hamza
Ameer Hamza il 5 Dic 2020
Modificato: Ameer Hamza il 5 Dic 2020
I am glad to be of help!!!

Accedi per commentare.

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by