How to sum unequal matrices of sizes 10X37 and 10X33?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ismail Qeshta
el 14 de Feb. de 2018
Editada: Ismail Qeshta
el 14 de Feb. de 2018
Hi, I have unequal matrices, with sizes 10X37 and 10X33, I usually manually fill in the difference between the 37 and 33 with zeros to make it work. However, I have thousands of similar files, which makes the process quite lengthy.
Can anyone please help me in this? I have attached the files to be summed, and provided my code below.
Thank you very much.
P1=importdata('Pier1.txt');
P2=importdata('Pier2.txt');
P3=importdata('Pier3.txt');
Force = [P1]+[P2]+[P3];
0 comentarios
Respuesta aceptada
KSSV
el 14 de Feb. de 2018
YOu have an option of changing all the matrices to same size by interpolation. Have a look on imresize, with this you can get all matrices to your desired size.
P1 = rand(10,37) ;
P2 = rand(10,33) ;
P1 = imresize(P1,[10 33]) ;
Más respuestas (0)
Ver también
Categorías
Más información sobre Quadratic Programming and Cone Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!