Function returning one value

clear
clc
close all
x = linspace(-8, 8, 19);
y = (x.*((x.^2)-1)/((x.^2)+1).^2);
figure
plot(x, y)

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 12 月 5 日
編集済み: Ameer Hamza 2020 年 12 月 5 日

0 投票

You need to use element-wise division
y = (x.*((x.^2)-1)./((x.^2)+1).^2);
%^ put a dot here

2 件のコメント

salar rohani nejad
salar rohani nejad 2020 年 12 月 5 日
thank you so much
Ameer Hamza
Ameer Hamza 2020 年 12 月 5 日
編集済み: Ameer Hamza 2020 年 12 月 5 日
I am glad to be of help!!!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2020 年 12 月 5 日

編集済み:

2020 年 12 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by