Selecting a row of numbers clockwise around a matrix of values
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi people,
I have an excel file as a matrix of random values (10 rows by 16 columns). I would like to select the value of outer cells, countiniously in clockwise direction (as illustrated in photo starting with cell #1 and ending with cell #17) and paste it as a row of 48 values into a new excel file. My ultimate goal is reading mutiple files in a folder ,and paste the same string row by row in a single excel file.
I appreciate your help and answers for learning and understanding it.
0 comentarios
Respuestas (1)
Image Analyst
el 20 de Oct. de 2021
mTop = m(1, :);
mLeft = m(2:end, end);
mBottom = fliplr(m(end, 1:end-1));
mRight = flipud(m(2:end-1, 1));
outerValues = [mTop(:); mLeft(:); mBottom(:); mRight(:)]
2 comentarios
Image Analyst
el 21 de Oct. de 2021
Put that code into a function, and call it inside a loop over the files. See the FAQ:
Ver también
Categorías
Más información sobre Spreadsheets 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!