Clear Filters
Clear Filters

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 views (last 30 days)
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

Answers (1)

Sam Chak
Sam Chak on 29 Sep 2023
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 Comments

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!