필터 지우기
필터 지우기

How do I plot the infinite norm of a matrix on a graph?. I should have a square but I end up having a circle

조회 수: 2 (최근 30일)
A=[2 0;1 -1]; Matrix A %(Sample Matrix)
infnorm=norm(A,inf) %Infinite norm
theta=linspace(0,2*pi,601); % Using 601 points
x=[cos(theta);sin(theta)];
plot(infnorm*x(1,:),infnorm*x(2,:),'--'), axis equal
title('Unit circle in Infinite-norm')
xlabel('x_1'), ylabel('x_2') %labels

답변 (1개)

Sam Chak
Sam Chak 2023년 9월 29일
Perhaps you want to plot something like this:
p = [1, 2^1, 2^2, 2^3, 2^4];
for j = 1:length(p)
f = @(x,y) abs(x).^p(j) + abs(y).^p(j) - 1;
fimplicit(f, [-3/2, 3/2, -3/2, 3/2])
hold on
end
hold off
grid on, xlabel('x_{1}'), ylabel('x_{2}')
axis square
title({'Unit circles in the $p$-norm'}, 'interpreter', 'latex', 'FontSize', 12)
text(0.25, 0.4, 'p = 1', 'FontSize', 9)
text(0.60, 0.60, '2', 'FontSize', 9)
text(0.75, 0.77, '4', 'FontSize', 9)
text(0.85, 0.88, '8', 'FontSize', 9)
text(1.00, 1.04, '16', 'FontSize', 9)
  댓글 수: 4
Sam Chak
Sam Chak 2023년 9월 29일
Has your problem been solved? If so, could you please run the code and share the square plot here?

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by