Array Comparison

1 次查看(过去 30 天)
AP
AP 2011-6-12
I have two vector V and myFilter. V contains the value of a variable in a 2D domain.
Suppose the 2D domain is a rectangle with the lower left corner (x1,y1) and upper right corner (x2,y2). This domain is discretized by 80 points in x and 60 points in y direction.
The elements of V is written rowwise from the (x1,y1) to (x2,y1) then moves to the next line and put them in the vector V.
My filter is a BW picture named myPicture. myFilter is obtained by myFilter=myPicture(:) which means myPicture is columnwise saved in myFilter.
Is there any efficient way of making V and myFilter consistent with each other so that V(i) and myFilter(i) refers to the same point in the 2D domain?
Thanks.

回答(1 个)

David Young
David Young 2011-6-12
Try
temp = myPicture.';
myFilter = temp(:);

类别

Help CenterFile Exchange 中查找有关 Big Data Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by