# Thread: Loglog graph of the condition number as a function of delta

1. ## Loglog graph of the condition number as a function of delta

Hello!

I'm new here as well as I am beginner in MatLab stuff . I've just started courses in MatLab programming on my studies. I have a problem to solve that I cannot carry out . Please help me or give me some hints.

I have a given matrix

For delta=1,0.1,0.01,…,1e-16

I need to create loglog graph of the condition number[cond(A,1)] as function of delta.

I have just made some attempts to do it, but it all crash just at the beggining.

% Sorry for my english if I have made some mistakes

Hello!

I'm new here as well as I am beginner in MatLab stuff . I've just started courses in MatLab programming on my studies. I have a problem to solve that I cannot carry out . Please help me or give me some hints.

I have a given matrix

For delta=1,0.1,0.01,…,1e-16

I need to create loglog graph of the condition number[cond(A,1)] as function of delta.

I have just made some attempts to do it, but it all crash just at the beggining.

% Sorry for my english if I have made some mistakes
The following will give you two arrays one containing the condition numbers the second the corresponding deltas, all you need do now is plot them.

Code:
cn=zeros(1,17);  %array to hold cond numbers
dd=zeros(1,17);  %array to hold deltas

for idx=0:16;
delta=10^(-idx);
A=[1-delta,delta;1/delta,1+delta]
cn(idx+1)=cond(A,1);
dd(idx+1)=delta;
end
CB

3. Thank you very much !!