필터 지우기
필터 지우기

Make polyfit instead of plot

조회 수: 1 (최근 30일)
rockstar49
rockstar49 2022년 9월 2일
답변: Walter Roberson 2022년 9월 2일
Hi,
id like to make this into a polyfit instead of a plot.
% Plotting of FRF
fig = figure(1000+p);p=p+1;
set(fig, 'WindowStyle', 'docked');
set(gcf,'color','w');
subplot(3,1,1);
if HOLD
hold on;
end
plot(f,abs(FRF), color, 'linewidth', 2);
ylim([0 1.5]);
xlim([0,f_range]);
grid on;box on;
ylabel('Speed/Speed*');
  댓글 수: 4
dpb
dpb 2022년 9월 2일
What in the world is FRF??? Does the plot bear any relationship to a polynomial of some degree?
With zero useful information, pretty-much at a loss here...
Star Strider
Star Strider 2022년 9월 2일
@Zakir Mahmood — What result do you want?
@dpb — Probably: Frequency Response Function.

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

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 2일
polynomial_degree = 3; %adjust as appropriate
p = polyfit(f, abs(FRF), polynomial_degree);
fig = figure(1000+p);p=p+1;
set(fig, 'WindowStyle', 'docked');
set(gcf,'color','w');
subplot(3,1,1);
if HOLD
hold on;
end
plot(f,abs(FRF), color, 'linewidth', 2, 'DisplayName', 'abs(FRF)');
y = polyval(p, f);
oldhold = hold('on');
plot(f, y, 'b', 'Linewidth', 2, 'DisplayName', 'fitted abs(FRF)');
hold(oldhold)
ylim([0 1.5]);
xlim([0,f_range]);
grid on;box on;
ylabel('Speed/Speed*');
legend show

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by