필터 지우기
필터 지우기

How to use Semilogy in MATLAB

조회 수: 4 (최근 30일)
Cillian
Cillian 2012년 5월 2일
Hello.
I want to make a graph with help of 'semilogy', the graph should display the Condition numbers grows with n.
This is my attempt so far:
for n=1:10, % loops from 1 to 10 n A=cond(n); % give us the Condition number A
semilogy(A) hold on end
grid on
When I debug my code, it results to no graph at all. I also thinking about to use 'norm', but perhaps it is already a part of the 'cond'?
Please, help me.
Regards Cillian

답변 (2개)

Thomas
Thomas 2012년 5월 2일
try saving A as a vector and move the plotting outside.
for n=1:10, % loops from 1 to 10 n
A(n)=cond(n); % give us the Condition number A
end
semilogy(A)
grid on

Wayne King
Wayne King 2012년 5월 2일
Why are you using semilogy in a for loop where you are only plotting a single value for A at a time?
Save the values of A in a vector.
A(n) =
then outside the for loop
semilogy(n,A)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by