Question

In: Computer Science

I need a working MATLAB CODE for the Gram Schimdt process Please give the code fast...

I need a working MATLAB CODE for the Gram Schimdt process

Please give the code fast

Its urgent

The code must run on any matrix given

It should be a generic code

Dont answer any wrong code or else i will badly dislike

Solutions

Expert Solution

Here is the MATLAB CODE:

It is a generic code which runs for any matrix. We can change the value of n for it to work on any matrix order

clc;clear all
n=3; %%n=3 for 3x3 matrix
X=randi(n,n); %%Random integers matrix
Wans=CGS(X) %%Function call
function W=CGS(V) %%Function which implements the Gram-Schmidt Algorithm for solution
[a b]=size(V);
for(i=1:a)
x(:,i)=V(:,i);
for(j=1:i-1)
x(:,i)=x(:,i)-(V(:,i)'*W(:,j))*W(:,j); %%Iterative formula
end
W(:,i)=x(:,i)/norm(x(:,i)); %%Normalisation
end
end


Related Solutions

I need matlab code for digital watermarking using SVD. Please explain each step
I need matlab code for digital watermarking using SVD. Please explain each step
i need matlab code of heat equation in 1D with convection ?
i need matlab code of heat equation in 1D with convection ?
Give me a working code in MATLAB for Crout Decomposition. The code must work totally fine...
Give me a working code in MATLAB for Crout Decomposition. The code must work totally fine and must break into 2 matrix L and U It must be in MATLAB The code used must use continue statement. If no continue statement is there in code it will be downvoted. Answer only if you know or else i will dislike badly
I need the code for following in C++ working for Visual studio please. Thanks Use a...
I need the code for following in C++ working for Visual studio please. Thanks Use a Struct to create a structure for a Player. The Player will have the following data that it needs maintain: Struct Player int health int level string playerName double gameComplete bool isGodMode Create the 2 functions that will do the following: 1) initialize(string aPlayerName) which takes in a playername string and creates a Player struct health= 100 level= 1 playerName = aPlayerName gameComplete = 0...
Give me a working MATLAB code for the Golden section search method . It should be...
Give me a working MATLAB code for the Golden section search method . It should be working Dont answer if you do not know, the code must work for the golden section method
pls, I need Matlab code for, OFDM modulation (Matlab demo by at least 4 carriers)
pls, I need Matlab code for, OFDM modulation (Matlab demo by at least 4 carriers)
Hello, I need the Matlab code of the Fourier Transform without using the Matlab functions fft...
Hello, I need the Matlab code of the Fourier Transform without using the Matlab functions fft and dft. Applied to discrete signals. If you can with an example.Thank you!!
C# I need working code please Write a console application that accepts the following JSON as...
C# I need working code please Write a console application that accepts the following JSON as input: {"menu": { "header": "SVG Viewer", "items": [ {"id": "Open"}, {"id": "OpenNew", "label": "Open New"}, null, {"id": "ZoomIn", "label": "Zoom In"}, {"id": "ZoomOut", "label": "Zoom Out"}, {"id": "OriginalView", "label": "Original View"}, null, {"id": "Quality"}, {"id": "Pause"}, {"id": "Mute"}, null, {"id": "Find", "label": "Find..."}, {"id": "FindAgain", "label": "Find Again"}, {"id": "Copy"}, {"id": "CopyAgain", "label": "Copy Again"}, {"id": "CopySVG", "label": "Copy SVG"}, {"id": "ViewSVG", "label": "View...
I need an original matlab code and gui for a simple double pendulum. This needs to...
I need an original matlab code and gui for a simple double pendulum. This needs to be original and not too complicated. Please provide basic instructions. Thank you!
I need a matlab code for my presentation. Code should include Single Sideband Amplitude Modulation and...
I need a matlab code for my presentation. Code should include Single Sideband Amplitude Modulation and Demodulation. It should figure 3 things: -time domain of given message signal in Amplitude Modulation and Single Sideband Amplitude Modulation -frequency domain of given signal in Amplitude Modulation and Single Sideband Amplitude Modulation -And it should demodulate and show message signal.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT