having trouble putting data into one matrix
having trouble putting data into one matrix
(OP)
I am trying to add matrix A and matrix B to matrix C
Here are my example Matrices
A=[5;4;3;2;1];
B=[6;8;7];
This is what I want
C=[5;4;3;2;1;6;8;7]
Here are my example Matrices
A=[5;4;3;2;1];
B=[6;8;7];
This is what I want
C=[5;4;3;2;1;6;8;7]





RE: having trouble putting data into one matrix
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: having trouble putting data into one matrix
RE: having trouble putting data into one matrix
Here is my code, I forgot to say that I am trying to Augment many files of different sizes togther to make one Mx1 matrix. the files range in size from 5 to 21 in length. this is the part of my code that does not work:
OX(ma:m,1) = NDPSORBIT_OX_m
the rest works, theoretically I thought this would work. can you point out my error please and lead me in the right direction? Thank you very much.
% Loads Data
[PathName, File, s2, srtlist] = UserData;
ma = 1;
for i=1:10
% Gets the Data
[filename] = GetDataMat(File, PathName, i);
% Loads the first file
load (filename)
% 'MxN'
mn = size(Net_array); % Size of the Matrix
% retrieves M % M= number of scans
m = mn(1,1); n = mn(1,2);
% Gets the info wanted from the file's variable
NDPSORBIT_OX_m = Net_array(1:m,2);
% Theoretically grabs the Matrices and concatenates them %into one matrix: this is the part that does not work
OX(ma:m,1) = NDPSORBIT_OX_m
% indexes the length of each matrix and adds the next one to % keep things in order
ma = ma +m
end
RE: having trouble putting data into one matrix