Following is a part of a code I am writing in matlab, here I want to carry out the following simple mathematical operation [A][X]=[B], where [X] is unknown. In my case I have length of k around 1600000. So all I want is to get the values for g1,g2 and g3 for each element on the array. I have tried the following
k31 = omega3./(d)
k32 = omega3_2./(d)
A = [2,1,5;-2,-1,-5];
X = [g1;g2;g3];
for ii = 1:length(k31)
B = [k31(ii); k32(ii)];
X = pinv(A).*B;
end
display(g1,g2,g3)
I am using pseudo-inverse so basically I can get a solution for each X and I have made some edit there....and x is unknown, MATHEMATICALLY it can be done, but am not able to code it
Also how do I plot the values of g1 g2 g3 with x and y as follows scatter(x(1:end-1), y(1:end-1), 5, g1); scatter(x(1:end-1), y(1:end-1), 5, g2) and scatter(x(1:end-1), y(1:end-1), 5, g3)