Function returning one value

조회 수: 20 (최근 30일)
salar rohani nejad
salar rohani nejad 2020년 12월 5일
편집: Ameer Hamza 2020년 12월 5일
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일
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!!!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by