how to store all my result in the same table
1 view (last 30 days)
Show older comments
hello..i need help plzz I want to store all my result in the same table..
*....................... T = zeros(3);
for i=1:numel(stats)
mark_i=mark == i;
mark_i_ends =bwmorph(mark_i,'endpoints');
[row,col]=find(mark_i_ends);
plot(col,row,'r.','markersize',5);
dist=sqrt((row(1)-row(2))^2 + (col(1)-col(2))^2);
bwdist=bwdistgeodesic(mark_i,col(1),row(1),'quasi-euclidean');
path=max(bwdist(:));
tortuosity=path/dist;
T(i,:,:,:) = [col,row,tortuosity];
end
*............................................
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
(line 56)
T(i,:,:,:) = [col,row,tortuosity];
0 Comments
Answers (1)
Image Analyst
on 10 Aug 2014
You define T as a 1D vector of 3 elements. Then you try to assign 3 elements to a 3D volume of a 4 dimensional array. You can't do that.
Preallocate T:
T = zeros(numel(stats), 3);
Then in the loop
T(i, :) = [col, row, tortuosity];
Do not call your variable bwdist! bwdist is a built-in function and I wouldn't be surprised if bwdistgeodesis used in internally, but you've blown it away by calling your variable that. Likewise, DO NOT CALL YOUR VARIABLE PATH! Again, it's a built-in function. You'll run into trouble if you destroy it like you're doing.
2 Comments
Image Analyst
on 10 Aug 2014
I'm truly stunned by your first statement where you ignored my advice not to name variables after built in functions. You didn't directly ask another question, but I'm not sure you would take my advice if I offered any. Good luck.
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!