필터 지우기
필터 지우기

What is the definition and operation of [row,col]

조회 수: 36 (최근 30일)
juan sanchez
juan sanchez 2018년 7월 8일
편집: Jan 2018년 7월 8일
What is the definition and operation of [row,col]
Does this mean all rows and all columns selected and read off a data file?>
  댓글 수: 1
dpb
dpb 2018년 7월 8일
편집: dpb 2018년 7월 8일
Alone, just creates a new array of unknown dimensions...it's indeterminate as to whether row, col are even variables (probably) or functions in isolation, however.
Must have context to know anything more...

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2018년 7월 8일
편집: Jan 2018년 7월 8일
It depends on what "row" and "col" are and on the context:
row = 2;
col = 3;
x = [row, col] % a [1 x 2] vector with the contents: [2,3]
% or:
y = rand(3,4)
[row, col] = size(y) % Now row is 3 and col is 4
Maybe:
row = 4;
col = 5;
x = rand(1, 20);
y = reshape(x, [row, col])
% Now y is a [4 x 5] matrix containing the elements of x
There are many further possible meanings, so please post the context. Maybe it helps, if you simply try it and run the code in the command window. Experiments can reveal the meaning very easily.

카테고리

Help CenterFile Exchange에서 Oceanography and Hydrology에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by