필터 지우기
필터 지우기

Please ask the code

조회 수: 1 (최근 30일)
T K
T K 2022년 10월 21일
댓글: T K 2022년 10월 22일
H

답변 (1개)

Jan
Jan 2022년 10월 22일
You overwrite the value of m multiple times:
m=3;
m=0.1;
m = linspace(0,0.001);
Because projfun is a nested function, it uses the last definition and the expression on the right hand side has 100 elements due to using the vector created by linspace.
This is a fragile code. The editor shows several problems already, so take the time to fix them.
Omit the clear command on top of a function, because it is just a waste of time there. This brute clearing header clc;clf;clear; is called "cargo cult programming".
for i = 1:numel(rr)
n=3; % Never used
...
i=i+1; % Why? This is not the way FOR loops work
end
If you share variables with nested functions, make it crystal clear using comments, which variables are concerned.
  댓글 수: 1
T K
T K 2022년 10월 22일
Thank alot

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by