Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function norma = normaMat(A ,typ)
- [m, n] = size(A);
- B = [];
- if(typ == "inf")
- for(i = 1:m)
- s = 0;
- for(j = 1:n)
- s = s + abs(A(i,j));
- B(i)=s;
- end
- end
- else if(typ == 1)
- for(i = 1:n)
- s = 0;
- for(j = 1:m)
- s = s + abs(A(j,i));
- B(i)=s;
- end
- end
- else
- error("Errore! Valore di norma errato!")
- end
- end
- norma = max(B);
- endfunction
Add Comment
Please, Sign In to add comment