Maj Muhammad Ali_MS80_Assignment 1

download Maj Muhammad Ali_MS80_Assignment 1

of 2

description

asdasd

Transcript of Maj Muhammad Ali_MS80_Assignment 1

Finite Element MethodAssignment 1Calculates transpose of a matrixPsuedo Code Initialize variables i.e. m = no of rows n = no of columns a = Initial matrix b = Transpose matrix Input matrix a Using size command to make source code as generic Initialize b matrix as a zero dummy matrix Use for loop to run iterations Initialize the count from 1 to m,n using logic to invert rows and columns of matrix Print transpose of matrixMatlab Codeclear all fprintf('\n Enter the matrix = ')a=input('');fprintf('\n') m=0;n=0;[m,n] = size(a);b(n,m)=0; for j=1:n for i=1:m b(j,i)=a(i,j); endendfprintf('the transpose of matrix \n');bOutput