Undefined sin_function_sf

%Using a script file (I)
clear;
format short g
%plot of sin with interval from [-pi,pi]
N=100;
x=linspace(-pi,pi,N)'
y=sin(x)
figure(1)
plot(x,y)
sf = 0.1
y = sin_scale(x,sf);
figure(2),
plot(x,y)
sf=[0.1 0.5 2];
N_sf = numel(sf);
sin_array = zeros(N,N_sf);
for ndx = 1: N_sf
sin_array(:,ndx) = sin_function_sf(x,sf(ndx));
end
figure(3),
plot(x,sin_array)
title(['A Sine fn; limits = [-pi pi]; Scale factors = ',num2str(sf)])
here is the code please, check this, and help me

6 件のコメント

KSSV
KSSV 2020 年 5 月 20 日
The function is not an inbuilt function.....if you have downloaded it from somewhere, copy those functions and save. If the functions are present see to it that they are present in the same working folder.
Zubair Ghafoor
Zubair Ghafoor 2020 年 5 月 20 日
is it a function? which I am mission or it a varriable.?
KSSV
KSSV 2020 年 5 月 20 日
Clearly thet are functions.
sin_scale, sin_function_sf
Zubair Ghafoor
Zubair Ghafoor 2020 年 5 月 20 日
no but i am not getting it.
Walter Roberson
Walter Roberson 2020 年 5 月 20 日
sin_scale = @(x,sf) sin(x) * sf;
sin_function_sf = sin_scale;
Zubair Ghafoor
Zubair Ghafoor 2020 年 5 月 20 日
Yes that's the right answer..
I have done the same thing and got the output

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

回答 (0 件)

カテゴリ

タグ

質問済み:

2020 年 5 月 20 日

コメント済み:

2020 年 5 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by