필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

dealing with values of cells

조회 수: 1 (최근 30일)
Aseel H
Aseel H 2013년 4월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
befor this question, I asked how divided the matrix to blocks, each block have size(1*3) example
matrix = [1 4 3 5 7 1;4 2 1 5 4 7;8 0 1 4 5 6] I need first block = [1 4 3] second block = [5 7 1] third block = [4 2 1] and so on
the answer was : result=mat2tiles(yourMatrix,[1,3]); it is OK, but how i can deal with the values of each cell
by meanning, I need to make some operation on the first values of all cells as multiple it by constant as 4 i.e the first cell will become = 4,4,3 the second cell will become = 20,7,1 and so on

답변 (1개)

Anand
Anand 2013년 4월 25일
Why do you need to divide it into blocks? Just do this:
matrix = matrix';
matrix(1:3:end) = 4*matrix(1:3:end);
matrix = matrix';

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by