answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

{

int a[10][10],sum=0,i,j,m,n,trace=0;

float norm;

printf("enter order");

scanf("%d %d",&m,&n);

printf("enter elements ");

for(i=0;i<m;i++)

{for(j=0;j<m;j++)

scanf("%d",&a[i][j]);

}

for(i=0;i<m;i++)

{

for(j=0;j<m;j++)

{

sum=sum+(a[i][j]*a[i][j]);

if(i==j)

trace=trace+a[i][j];

}

}

norm=sqrt(sum);

printf("norm=%f\n trace=%d",norm,trace);

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find trace and norm of a matrix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a java package program for addition?

A number of well-tested open-source Matrix Java libraries are available. Best to find and use one that's been around for a while since most of the bugs have been worked out. If you need to write your own it's still worth-while to examine the APIs of those libraries first.JAMA is a free Java library for basic linear algebra and matrix operations developed as a straightforward public-domain reference implementation by MathWorks and NIST.Example of Use. The following simple example solves a 3x3 linear system Ax=b and computes the norm of the residual.double[][] array = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}};Matrix A = new Matrix(array);Matrix b = Matrix.random(3,1);Matrix x = A.solve(b);Matrix Residual = A.times(x).minus(b);double rnorm = Residual.normInf();


What is the importance of thread?

thread is a light weight program . concurrent execution of code can be done by usin threads.thread is a part of the program.


Explain Shearing and reflection as a technique of 2d transformation?

ShearingFor shear mapping (visually similar to slanting), there are two possibilities. For a shear parallel to the x axis has x' = x + ky and y' = y; the shear matrix, applied to column vectors, is: A shear parallel to the y axis has x' = xand y' = y + kx, which has matrix form:ReflectionTo reflect a vector about a line that goes through the origin, let be a vector in the direction of the line: To reflect a point through a plane ax + by + cz = 0 (which goes through the origin), one can use , where is the 3x3 identity matrix and is the three-dimensional unit vector for the surface normal of the plane. If the L2 norm of a,b, and c is unity, the transformation matrix can be expressed as:Note that these are particular cases of a Householder reflection in two and three dimensions. A reflection about a line or plane that does not go through the origin is not a linear transformation; it is an affine transformation.


What is the abbreviation of EN material?

En 8 Stands for Euro - NOrm


What psi is considered a high pressure pneumatic system?

factory air pressure norm is 80 psi

Related questions

C program to find trace and norm of a matrix using command line arguments?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;math.h&gt; void main() { int a[10][10],sum=0,i,j,m,n,trace=0; float norm; printf("enter order"); scanf("%d %d",&amp;m,&amp;n); printf("enter elements "); for(i=0;i&lt;m;i++) {for(j=0;j&lt;m;j++) scanf("%d",&amp;a[i][j]); } for(i=0;i&lt;m;i++) { for(j=0;j&lt;m;j++) { sum=sum+(a[i][j]*a[i][j]); if(i==j) trace=trace+a[i][j]; } } norm=sqrt(sum); printf("norm=%f\n trace=%d",norm,trace); }


How to prove that the spectral radius of a symmetric square matrix on real numbers is not larger than the 1-norm of the matrix?

Let's prove that rho(A)=2-norm(A) for A symmetrical and then prove the relation between 1-norm and 2-norm. Both are easy.


How do you compute norm on matlab?

using the function norm(A,x) where A is the matrix/vector that you have to compute the norm for and x can be 1,2,inf, or 'fro' to compute the 1-norm, 2-norm, infinite-norm and frobenius norm respectively.


How can we compute norm in mathematics?

It depends on what space your in. If its the supremum norm on a function space then just look for the max of the function. If its the euclidean norm then just takes squares, add, take the square root. Whats more interesting is that its often very hard to compute norms. For instance, even computing the norm of a 2x2 matrix is no easy problem if the matrix isn't diagonalizable. Computing the norm of a given operator on a infinite dimensional Hilbert space is very hard indeed...


How do you write a java package program for addition?

A number of well-tested open-source Matrix Java libraries are available. Best to find and use one that's been around for a while since most of the bugs have been worked out. If you need to write your own it's still worth-while to examine the APIs of those libraries first.JAMA is a free Java library for basic linear algebra and matrix operations developed as a straightforward public-domain reference implementation by MathWorks and NIST.Example of Use. The following simple example solves a 3x3 linear system Ax=b and computes the norm of the residual.double[][] array = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}};Matrix A = new Matrix(array);Matrix b = Matrix.random(3,1);Matrix x = A.solve(b);Matrix Residual = A.times(x).minus(b);double rnorm = Residual.normInf();


What is a postscriptive norm?

A postcriptive norm is a norm you 'ought not to do'. Something you shouldn't do.


What are the release dates for The Norm Show - 1999 Norm vs- Norm 2-9?

The Norm Show - 1999 Norm vs- Norm 2-9 was released on: USA: 17 November 1999


Define the condition number of a matrix?

Matrix Condition NumberThe condition number for matrix inversion with respect to a matrix norm k&cent;k of a square matrix A is defined by&#8729;(A)=kAkkA&iexcl;1k;if A is non-singular; and &#8729;(A)=+1 if A is singular.The condition number is a measure of stability or sensitivity of a matrix (or the linear system it represents) to numerical operations. In other words, we may not be able to trust the results of computations on an ill-conditioned matrix.Matrices with condition numbers near 1 are said to be well-conditioned. Matrices with condition numbers much greater than one (such as around 105 for a 5&pound;5Hilbert matrix) are said to be ill-conditioned.If &#8729;(A) is the condition number of A , then &#8729;(A) measures a sort of inverse distance from A to the set of singular matrices, normalized by kAk . Precisely, if A isinvertible, and kB&iexcl;Ak


Is every unitary matrix hermitian?

Absolutely not. They are rather quite different: hermitian matrices usually change the norm of vector while unitary ones do not (you can convince yourself by taking the spectral decomposition: eigenvalues of unitary operators are phase factors while an hermitian matrix has real numbers as eigenvalues so they modify the norm of vectors). So unitary matrices are good "maps" whiule hermitian ones are not. If you think about it a little bit you will be able to demonstrate the following: for every Hilbert space except C^2 a unitary matrix cannot be hermitian and vice versa. For the particular case H=C^2 this is not true (e.g. Pauli matrices are hermitian and unitary).


How do you use norms in a sentence?

Norm walked to the store and saw his friend, Norm.


What is the moral norm?

A norm is an accepted or typical behavior in a group of people. So a moral norm is the morality that is expected of people in their social group. For example, it is a moral norm in society that one shouldn't steal. It is not a moral norm to match your socks (it's a norm to match them, but it isn't immoral to mismatch them, so it's not a moral norm). Where does the norm come from? God, society, nature, self, and any combination of them.


How tall is Norm Golden?

Norm Golden is 6'.