Author Topic: Simple data fomatting problem!  (Read 668 times)

Offline paul smyth

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
Simple data fomatting problem!
« on: August 06, 2009, 03:15:51 PM »
Hello,

heres my problem;

I have the following lines of code, which I use to evaluate the variable 'perimeter'; the perimeter's of various objects detected by a camera.

for k = 1:length(B);

% obtain (X,Y) boundary coordinates corresponding to label 'k'%

boundary = B{k};

% compute estimate of objects perimeter%

delta_sq = diff(boundary).^2;

perimeter = sum(sqrt(sum(delta_sq,2)))


This code returns to me the following (if say there were three objects on screen):

perimeter =

464.3991


perimeter =

446.0315


perimeter =

437.6884


But I need to display these values as follows (say in another variable, 'X'):

X =

464.3991              446.0315             437.6884

I need some piece of syntax relating 'perimeter' to 'X' but I dont know what it is, despite hours of looking.

Any help would be greatly appreciated!

Matlab and SimuLink Development Forum

Simple data fomatting problem!
« on: August 06, 2009, 03:15:51 PM »