why I cant run this program?

조회 수: 1 (최근 30일)
Kuheli Mondal
Kuheli Mondal 2016년 3월 30일
댓글: Muhammad Usman Saleem 2016년 3월 31일
function x=signal(f,fs,N)
% sinusoid
f=30; %frequency,
N=10; %number of samples
fs=100; %sampling frequency
A=2; %amplitute
Total sampling time = 1 second
n = 0:N-1; % numbering the samples
x = A*sin(2*pi*f*n/fs);
plot(x)
MFx = abs(fft(x));
frek=(0:N/2-1)*fs/N;
plot(frek,MFx(1:N/2))% plot the positive frequencies
please help me.
thank you
  댓글 수: 4
Kuheli Mondal
Kuheli Mondal 2016년 3월 31일
now its runing..Thank you all..........
Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 3월 31일
fine. Then please accept my answer. if you would like

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

채택된 답변

Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 3월 30일
mark this line as comment
%Total sampling time = 1 second
  댓글 수: 3
Walter Roberson
Walter Roberson 2016년 3월 31일
You need to tell us how you are running the program, and you need to show the complete error message.
Image Analyst
Image Analyst 2016년 3월 31일
Kuehli, now you've been asked three times to show what you did. What arguments you supplied and how you ran it. Did you overlook the two comments up at the top? Why did you not answer them? Why don't you want to make it easy to help you instead of hard or impossible?

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

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 3월 31일
Kuheli, the attached m-file (below the plot) runs perfectly fine. It runs via the green run triangle, and it runs via typing F5. AND it runs with no errors at all and makes the plot below. It's all in one m-file, text3.m and is attached. If you can't run it, let me know, otherwise you can Accept this answer.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by